Chef tool : saying need to mention version while installing httpd





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







2















Code I have written



[root@ns1 sysadmin]# cat installstarthttpd.rb 
package' httpd'

service 'httpd' do
action [:start, :enable]
end

file '/var/www/html/index.html' do
content ' <html>
<title>
Page from Chef
</title>
<body>
<h1> Welcome Raja</h1>
</body>
</html>
'
end

[root@ns1 sysadmin]#


And I have executed with below command and got error like



[root@ns1 sysadmin]# chef-apply installstarthttpd.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* package[ httpd] action install
* No version specified, and no candidate version available for httpd
================================================================================
Error executing action `install` on resource 'package[ httpd]'
================================================================================

Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for httpd

Resource Declaration:
---------------------
# In installstarthttpd.rb

1: package' httpd'
2:

Compiled Resource:
------------------
# Declared in installstarthttpd.rb:1:in `run_chef_recipe'

package(" httpd") do
action :install
retries 0
retry_delay 2
guard_interpreter :default
package_name " httpd"
timeout 900
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end

[2014-10-14T01:10:18-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-10-14T01:10:18-04:00] FATAL: Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd


I have seen the log too



[root@ns1 sysadmin]# cat /var/chef/cache/chef-stacktrace.out 
Generated at 2014-10-14 01:10:18 -0400
Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:241:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:322:in `block in run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:135:in `process_resource_requirements'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:111:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:144:in `run_chef_recipe'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:153:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:166:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-apply:25:in `<top (required)>'
/usr/bin/chef-apply:34:in `load'


Please help me , am I missing anything ?



Thank you.










share|improve this question

























  • anybody can help me ?

    – shekhar
    Oct 15 '14 at 6:37


















2















Code I have written



[root@ns1 sysadmin]# cat installstarthttpd.rb 
package' httpd'

service 'httpd' do
action [:start, :enable]
end

file '/var/www/html/index.html' do
content ' <html>
<title>
Page from Chef
</title>
<body>
<h1> Welcome Raja</h1>
</body>
</html>
'
end

[root@ns1 sysadmin]#


And I have executed with below command and got error like



[root@ns1 sysadmin]# chef-apply installstarthttpd.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* package[ httpd] action install
* No version specified, and no candidate version available for httpd
================================================================================
Error executing action `install` on resource 'package[ httpd]'
================================================================================

Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for httpd

Resource Declaration:
---------------------
# In installstarthttpd.rb

1: package' httpd'
2:

Compiled Resource:
------------------
# Declared in installstarthttpd.rb:1:in `run_chef_recipe'

package(" httpd") do
action :install
retries 0
retry_delay 2
guard_interpreter :default
package_name " httpd"
timeout 900
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end

[2014-10-14T01:10:18-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-10-14T01:10:18-04:00] FATAL: Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd


I have seen the log too



[root@ns1 sysadmin]# cat /var/chef/cache/chef-stacktrace.out 
Generated at 2014-10-14 01:10:18 -0400
Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:241:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:322:in `block in run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:135:in `process_resource_requirements'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:111:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:144:in `run_chef_recipe'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:153:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:166:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-apply:25:in `<top (required)>'
/usr/bin/chef-apply:34:in `load'


Please help me , am I missing anything ?



Thank you.










share|improve this question

























  • anybody can help me ?

    – shekhar
    Oct 15 '14 at 6:37














2












2








2


1






Code I have written



[root@ns1 sysadmin]# cat installstarthttpd.rb 
package' httpd'

service 'httpd' do
action [:start, :enable]
end

file '/var/www/html/index.html' do
content ' <html>
<title>
Page from Chef
</title>
<body>
<h1> Welcome Raja</h1>
</body>
</html>
'
end

[root@ns1 sysadmin]#


And I have executed with below command and got error like



[root@ns1 sysadmin]# chef-apply installstarthttpd.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* package[ httpd] action install
* No version specified, and no candidate version available for httpd
================================================================================
Error executing action `install` on resource 'package[ httpd]'
================================================================================

Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for httpd

Resource Declaration:
---------------------
# In installstarthttpd.rb

1: package' httpd'
2:

Compiled Resource:
------------------
# Declared in installstarthttpd.rb:1:in `run_chef_recipe'

package(" httpd") do
action :install
retries 0
retry_delay 2
guard_interpreter :default
package_name " httpd"
timeout 900
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end

[2014-10-14T01:10:18-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-10-14T01:10:18-04:00] FATAL: Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd


I have seen the log too



[root@ns1 sysadmin]# cat /var/chef/cache/chef-stacktrace.out 
Generated at 2014-10-14 01:10:18 -0400
Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:241:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:322:in `block in run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:135:in `process_resource_requirements'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:111:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:144:in `run_chef_recipe'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:153:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:166:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-apply:25:in `<top (required)>'
/usr/bin/chef-apply:34:in `load'


Please help me , am I missing anything ?



Thank you.










share|improve this question
















Code I have written



[root@ns1 sysadmin]# cat installstarthttpd.rb 
package' httpd'

service 'httpd' do
action [:start, :enable]
end

file '/var/www/html/index.html' do
content ' <html>
<title>
Page from Chef
</title>
<body>
<h1> Welcome Raja</h1>
</body>
</html>
'
end

[root@ns1 sysadmin]#


And I have executed with below command and got error like



[root@ns1 sysadmin]# chef-apply installstarthttpd.rb
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* package[ httpd] action install
* No version specified, and no candidate version available for httpd
================================================================================
Error executing action `install` on resource 'package[ httpd]'
================================================================================

Chef::Exceptions::Package
-------------------------
No version specified, and no candidate version available for httpd

Resource Declaration:
---------------------
# In installstarthttpd.rb

1: package' httpd'
2:

Compiled Resource:
------------------
# Declared in installstarthttpd.rb:1:in `run_chef_recipe'

package(" httpd") do
action :install
retries 0
retry_delay 2
guard_interpreter :default
package_name " httpd"
timeout 900
cookbook_name "(chef-apply cookbook)"
recipe_name "(chef-apply recipe)"
end

[2014-10-14T01:10:18-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2014-10-14T01:10:18-04:00] FATAL: Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd


I have seen the log too



[root@ns1 sysadmin]# cat /var/chef/cache/chef-stacktrace.out 
Generated at 2014-10-14 01:10:18 -0400
Chef::Exceptions::Package: package[ httpd] ((chef-apply cookbook)::(chef-apply recipe) line 1) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for httpd
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:241:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:322:in `block in run'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:321:in `run'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:135:in `process_resource_requirements'
/opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:111:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
/opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:144:in `run_chef_recipe'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:153:in `run_application'
/opt/chefdk/embedded/apps/chef/lib/chef/application/apply.rb:166:in `run'
/opt/chefdk/embedded/apps/chef/bin/chef-apply:25:in `<top (required)>'
/usr/bin/chef-apply:34:in `load'


Please help me , am I missing anything ?



Thank you.







installation apache-http-server chef






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 14 '14 at 9:09







shekhar

















asked Oct 14 '14 at 5:31









shekharshekhar

5791716




5791716













  • anybody can help me ?

    – shekhar
    Oct 15 '14 at 6:37



















  • anybody can help me ?

    – shekhar
    Oct 15 '14 at 6:37

















anybody can help me ?

– shekhar
Oct 15 '14 at 6:37





anybody can help me ?

– shekhar
Oct 15 '14 at 6:37










3 Answers
3






active

oldest

votes


















0














The most likely issue you're having is that your yum database has not been updated. You have two options:





  1. Update the yum database manually on your machines using:



    sudo yum update –y



  2. Create a chef recipe (or line in another chef recipe) which updates the yum database before running the rest of your commands. You can do this with the following line:



    execute 'yum update -y'







share|improve this answer































    0














    I had same problem. RedHat can not download httpd from repository. You need to configure CentOs-Base repo fot RedHat.




    1. Create a file centos-base.repo with the follwing contents in /etc/yum.repos.d (change the release version of this file, the below snapshot is for release version 6)


    yum.repos.d



    #####################################################################
    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client. You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #

    [base]
    name=CentOS-6 - Base
    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
    #baseurl=http://mirror.centos.org/centos/6/os/$basearch/
    gpgcheck=1
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #released updates
    [updates]
    name=CentOS-6 - Updates
    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
    #baseurl=http://mirror.centos.org/centos/6/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #additional packages that may be useful
    [extras]
    name=CentOS-6 - Extras
    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
    #baseurl=http://mirror.centos.org/centos/6/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-6 - Plus
    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
    #baseurl=http://mirror.centos.org/centos/6/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-6 - Contrib
    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
    #baseurl=http://mirror.centos.org/centos/6/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


    #####################################################################




    1. Download the gpg key for your release of O.S from centos official site http://mirror.centos.org/centos/ and move it to /etc/pki/rpm-gpg/



      2.1 $cd /etc/pki/rpm-gpg/



      2.2 $wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6




    Important



    Also check you internet connection. From my experience sometime Linux do not "see" network with default settings.



    Primary source



    Original source here






    share|improve this answer

































      0














      remove the space which you had put before h while writing a package name. it should be 'httpd' not ' httpd'






      share|improve this answer
























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "3"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f825928%2fchef-tool-saying-need-to-mention-version-while-installing-httpd%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        The most likely issue you're having is that your yum database has not been updated. You have two options:





        1. Update the yum database manually on your machines using:



          sudo yum update –y



        2. Create a chef recipe (or line in another chef recipe) which updates the yum database before running the rest of your commands. You can do this with the following line:



          execute 'yum update -y'







        share|improve this answer




























          0














          The most likely issue you're having is that your yum database has not been updated. You have two options:





          1. Update the yum database manually on your machines using:



            sudo yum update –y



          2. Create a chef recipe (or line in another chef recipe) which updates the yum database before running the rest of your commands. You can do this with the following line:



            execute 'yum update -y'







          share|improve this answer


























            0












            0








            0







            The most likely issue you're having is that your yum database has not been updated. You have two options:





            1. Update the yum database manually on your machines using:



              sudo yum update –y



            2. Create a chef recipe (or line in another chef recipe) which updates the yum database before running the rest of your commands. You can do this with the following line:



              execute 'yum update -y'







            share|improve this answer













            The most likely issue you're having is that your yum database has not been updated. You have two options:





            1. Update the yum database manually on your machines using:



              sudo yum update –y



            2. Create a chef recipe (or line in another chef recipe) which updates the yum database before running the rest of your commands. You can do this with the following line:



              execute 'yum update -y'








            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 26 '14 at 3:18









            aronchickaronchick

            6411921




            6411921

























                0














                I had same problem. RedHat can not download httpd from repository. You need to configure CentOs-Base repo fot RedHat.




                1. Create a file centos-base.repo with the follwing contents in /etc/yum.repos.d (change the release version of this file, the below snapshot is for release version 6)


                yum.repos.d



                #####################################################################
                # CentOS-Base.repo
                #
                # The mirror system uses the connecting IP address of the client and the
                # update status of each mirror to pick mirrors that are updated to and
                # geographically close to the client. You should use this for CentOS updates
                # unless you are manually picking other mirrors.
                #
                # If the mirrorlist= does not work for you, as a fall back you can try the
                # remarked out baseurl= line instead.
                #
                #

                [base]
                name=CentOS-6 - Base
                mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
                #baseurl=http://mirror.centos.org/centos/6/os/$basearch/
                gpgcheck=1
                enabled=1
                gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                #released updates
                [updates]
                name=CentOS-6 - Updates
                mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
                #baseurl=http://mirror.centos.org/centos/6/updates/$basearch/
                gpgcheck=1
                gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                #additional packages that may be useful
                [extras]
                name=CentOS-6 - Extras
                mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
                #baseurl=http://mirror.centos.org/centos/6/extras/$basearch/
                gpgcheck=1
                gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                #additional packages that extend functionality of existing packages
                [centosplus]
                name=CentOS-6 - Plus
                mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
                #baseurl=http://mirror.centos.org/centos/6/centosplus/$basearch/
                gpgcheck=1
                enabled=0
                gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                #contrib - packages by Centos Users
                [contrib]
                name=CentOS-6 - Contrib
                mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
                #baseurl=http://mirror.centos.org/centos/6/contrib/$basearch/
                gpgcheck=1
                enabled=0
                gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


                #####################################################################




                1. Download the gpg key for your release of O.S from centos official site http://mirror.centos.org/centos/ and move it to /etc/pki/rpm-gpg/



                  2.1 $cd /etc/pki/rpm-gpg/



                  2.2 $wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6




                Important



                Also check you internet connection. From my experience sometime Linux do not "see" network with default settings.



                Primary source



                Original source here






                share|improve this answer






























                  0














                  I had same problem. RedHat can not download httpd from repository. You need to configure CentOs-Base repo fot RedHat.




                  1. Create a file centos-base.repo with the follwing contents in /etc/yum.repos.d (change the release version of this file, the below snapshot is for release version 6)


                  yum.repos.d



                  #####################################################################
                  # CentOS-Base.repo
                  #
                  # The mirror system uses the connecting IP address of the client and the
                  # update status of each mirror to pick mirrors that are updated to and
                  # geographically close to the client. You should use this for CentOS updates
                  # unless you are manually picking other mirrors.
                  #
                  # If the mirrorlist= does not work for you, as a fall back you can try the
                  # remarked out baseurl= line instead.
                  #
                  #

                  [base]
                  name=CentOS-6 - Base
                  mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
                  #baseurl=http://mirror.centos.org/centos/6/os/$basearch/
                  gpgcheck=1
                  enabled=1
                  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                  #released updates
                  [updates]
                  name=CentOS-6 - Updates
                  mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
                  #baseurl=http://mirror.centos.org/centos/6/updates/$basearch/
                  gpgcheck=1
                  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                  #additional packages that may be useful
                  [extras]
                  name=CentOS-6 - Extras
                  mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
                  #baseurl=http://mirror.centos.org/centos/6/extras/$basearch/
                  gpgcheck=1
                  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                  #additional packages that extend functionality of existing packages
                  [centosplus]
                  name=CentOS-6 - Plus
                  mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
                  #baseurl=http://mirror.centos.org/centos/6/centosplus/$basearch/
                  gpgcheck=1
                  enabled=0
                  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                  #contrib - packages by Centos Users
                  [contrib]
                  name=CentOS-6 - Contrib
                  mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
                  #baseurl=http://mirror.centos.org/centos/6/contrib/$basearch/
                  gpgcheck=1
                  enabled=0
                  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


                  #####################################################################




                  1. Download the gpg key for your release of O.S from centos official site http://mirror.centos.org/centos/ and move it to /etc/pki/rpm-gpg/



                    2.1 $cd /etc/pki/rpm-gpg/



                    2.2 $wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6




                  Important



                  Also check you internet connection. From my experience sometime Linux do not "see" network with default settings.



                  Primary source



                  Original source here






                  share|improve this answer




























                    0












                    0








                    0







                    I had same problem. RedHat can not download httpd from repository. You need to configure CentOs-Base repo fot RedHat.




                    1. Create a file centos-base.repo with the follwing contents in /etc/yum.repos.d (change the release version of this file, the below snapshot is for release version 6)


                    yum.repos.d



                    #####################################################################
                    # CentOS-Base.repo
                    #
                    # The mirror system uses the connecting IP address of the client and the
                    # update status of each mirror to pick mirrors that are updated to and
                    # geographically close to the client. You should use this for CentOS updates
                    # unless you are manually picking other mirrors.
                    #
                    # If the mirrorlist= does not work for you, as a fall back you can try the
                    # remarked out baseurl= line instead.
                    #
                    #

                    [base]
                    name=CentOS-6 - Base
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
                    #baseurl=http://mirror.centos.org/centos/6/os/$basearch/
                    gpgcheck=1
                    enabled=1
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #released updates
                    [updates]
                    name=CentOS-6 - Updates
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
                    #baseurl=http://mirror.centos.org/centos/6/updates/$basearch/
                    gpgcheck=1
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #additional packages that may be useful
                    [extras]
                    name=CentOS-6 - Extras
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
                    #baseurl=http://mirror.centos.org/centos/6/extras/$basearch/
                    gpgcheck=1
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #additional packages that extend functionality of existing packages
                    [centosplus]
                    name=CentOS-6 - Plus
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
                    #baseurl=http://mirror.centos.org/centos/6/centosplus/$basearch/
                    gpgcheck=1
                    enabled=0
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #contrib - packages by Centos Users
                    [contrib]
                    name=CentOS-6 - Contrib
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
                    #baseurl=http://mirror.centos.org/centos/6/contrib/$basearch/
                    gpgcheck=1
                    enabled=0
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


                    #####################################################################




                    1. Download the gpg key for your release of O.S from centos official site http://mirror.centos.org/centos/ and move it to /etc/pki/rpm-gpg/



                      2.1 $cd /etc/pki/rpm-gpg/



                      2.2 $wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6




                    Important



                    Also check you internet connection. From my experience sometime Linux do not "see" network with default settings.



                    Primary source



                    Original source here






                    share|improve this answer















                    I had same problem. RedHat can not download httpd from repository. You need to configure CentOs-Base repo fot RedHat.




                    1. Create a file centos-base.repo with the follwing contents in /etc/yum.repos.d (change the release version of this file, the below snapshot is for release version 6)


                    yum.repos.d



                    #####################################################################
                    # CentOS-Base.repo
                    #
                    # The mirror system uses the connecting IP address of the client and the
                    # update status of each mirror to pick mirrors that are updated to and
                    # geographically close to the client. You should use this for CentOS updates
                    # unless you are manually picking other mirrors.
                    #
                    # If the mirrorlist= does not work for you, as a fall back you can try the
                    # remarked out baseurl= line instead.
                    #
                    #

                    [base]
                    name=CentOS-6 - Base
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
                    #baseurl=http://mirror.centos.org/centos/6/os/$basearch/
                    gpgcheck=1
                    enabled=1
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #released updates
                    [updates]
                    name=CentOS-6 - Updates
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates
                    #baseurl=http://mirror.centos.org/centos/6/updates/$basearch/
                    gpgcheck=1
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #additional packages that may be useful
                    [extras]
                    name=CentOS-6 - Extras
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras
                    #baseurl=http://mirror.centos.org/centos/6/extras/$basearch/
                    gpgcheck=1
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #additional packages that extend functionality of existing packages
                    [centosplus]
                    name=CentOS-6 - Plus
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus
                    #baseurl=http://mirror.centos.org/centos/6/centosplus/$basearch/
                    gpgcheck=1
                    enabled=0
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

                    #contrib - packages by Centos Users
                    [contrib]
                    name=CentOS-6 - Contrib
                    mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib
                    #baseurl=http://mirror.centos.org/centos/6/contrib/$basearch/
                    gpgcheck=1
                    enabled=0
                    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6


                    #####################################################################




                    1. Download the gpg key for your release of O.S from centos official site http://mirror.centos.org/centos/ and move it to /etc/pki/rpm-gpg/



                      2.1 $cd /etc/pki/rpm-gpg/



                      2.2 $wget http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6




                    Important



                    Also check you internet connection. From my experience sometime Linux do not "see" network with default settings.



                    Primary source



                    Original source here







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Dec 4 '14 at 7:56

























                    answered Dec 3 '14 at 9:40









                    CherryCherry

                    4291614




                    4291614























                        0














                        remove the space which you had put before h while writing a package name. it should be 'httpd' not ' httpd'






                        share|improve this answer




























                          0














                          remove the space which you had put before h while writing a package name. it should be 'httpd' not ' httpd'






                          share|improve this answer


























                            0












                            0








                            0







                            remove the space which you had put before h while writing a package name. it should be 'httpd' not ' httpd'






                            share|improve this answer













                            remove the space which you had put before h while writing a package name. it should be 'httpd' not ' httpd'







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Feb 29 '16 at 7:39









                            Sameer KulkarniSameer Kulkarni

                            1




                            1






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Super User!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f825928%2fchef-tool-saying-need-to-mention-version-while-installing-httpd%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                                Alcedinidae

                                RAC Tourist Trophy