# \[Solved\] Install apache2 on the ubuntu virtual box using chef-client

**URL:** <https://discourse.chef.io/t/solved-install-apache2-on-the-ubuntu-virtual-box-using-chef-client/11433>\
**Category:** Chef Infra (archive)\
**Created:** [September 2, 2017, 11:48am UTC](https://discourse.chef.io/t/solved-install-apache2-on-the-ubuntu-virtual-box-using-chef-client/11433 "2017-09-02T11:48:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priti](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/priti/32/2024_2.png) [@Priti](https://discourse.chef.io/u/Priti)\
**Post date:** [September 2, 2017, 11:48am UTC](https://discourse.chef.io/t/solved-install-apache2-on-the-ubuntu-virtual-box-using-chef-client/11433/1 "2017-09-02T11:48:44Z")

</div>

I’m going through chef-learning tutorials ([learn.chef.io](http://learn.chef.io)) and I’m stuck at installation of apache.

I’m using virtual box and chef-client.

Refer the gist for the receipt I’m running: [recipe for apache2](https://gist.github.com/pritibiyani/5254706dce0b1a26237d2b05d432ad97)

When I run chef-client in local mode, I’m getting following error:

Running handlers:  
[2017-09-02T11:34:18+00:00] ERROR: Running exception handlers  
Running handlers complete  
[2017-09-02T11:34:18+00:00] ERROR: Exception handlers complete  
Chef Client failed. 0 resources updated in 28 seconds  
[2017-09-02T11:34:18+00:00] FATAL: Stacktrace dumped to /root/.chef/local-mode-cache/cache/chef-stacktrace.out  
[2017-09-02T11:34:18+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report  
[2017-09-02T11:34:18+00:00] ERROR: yum\_package[apache2] (@recipe\_files::/home/vagrant/chef-repo/webserver.rb line 6) had an error: Chef::Exceptions:📦 No candidate version available for apache2  
[2017-09-02T11:34:18+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

---

<div class="post-metadata">

**Author:** ![naunga](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/naunga/32/2002_2.png) [@naunga](https://discourse.chef.io/u/naunga)\
**Post date:** [September 2, 2017, 12:27pm UTC](https://discourse.chef.io/t/solved-install-apache2-on-the-ubuntu-virtual-box-using-chef-client/11433/2 "2017-09-02T12:27:31Z")

</div>

Your subject line says you’re using Ubuntu, but looks like the error is  
being generated by the yum\_package resource, which would make me think  
you’re using a Red Hat based distro like CentOS.

In any event, the yum package for Apache2 is typically httpd. So try  
changing the package name to that.

---

<div class="post-metadata">

**Author:** ![csanter](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@csanter](https://discourse.chef.io/u/csanter)\
**Post date:** [December 20, 2018, 6:21pm UTC](https://discourse.chef.io/t/solved-install-apache2-on-the-ubuntu-virtual-box-using-chef-client/11433/3 "2018-12-20T18:21:42Z")

</div>

I am curious to know how you resolved this. I am using Ubuntu 16.04
