{"action":"created","issue":{"url":"https://api.github.com/repos/chef-cookbooks/build-essential/issues/41","labels_url":"https://api.github.com/repos/chef-cookbooks/build-essential/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/chef-cookbooks/build-essential/issues/41/comments","events_url":"https://api.github.com/repos/chef-cookbooks/build-essential/issues/41/events","html_url":"https://github.com/chef-cookbooks/build-essential/issues/41","id":38644519,"number":41,"title":"Not running apt-get update before installing packages","user":{"login":"naphthalene","id":1704620,"avatar_url":"https://avatars.githubusercontent.com/u/1704620?v=3","gravatar_id":"","url":"https://api.github.com/users/naphthalene","html_url":"https://github.com/naphthalene","followers_url":"https://api.github.com/users/naphthalene/followers","following_url":"https://api.github.com/users/naphthalene/following{/other_user}","gists_url":"https://api.github.com/users/naphthalene/gists{/gist_id}","starred_url":"https://api.github.com/users/naphthalene/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naphthalene/subscriptions","organizations_url":"https://api.github.com/users/naphthalene/orgs","repos_url":"https://api.github.com/users/naphthalene/repos","events_url":"https://api.github.com/users/naphthalene/events{/privacy}","received_events_url":"https://api.github.com/users/naphthalene/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-07-24T15:42:16Z","updated_at":"2015-09-10T16:06:31Z","closed_at":"2014-11-18T17:01:59Z","body":"`chef-client` versions tried: `11.12.8` & `11.6.0`\r\n`build-essential` version `2.0.4`\r\n\r\nHello,\r\n\r\nRunning into an issue today where chef run fails to install build-essential cookbook for the following reason:\r\n```\r\n  * package[build-essential] action install\r\n================================================================================\r\nError executing action `install` on resource 'package[build-essential]'\r\n================================================================================\r\n\r\n\r\nMixlib::ShellOut::ShellCommandFailed\r\n------------------------------------\r\nExpected process to exit with [0], but received '100'\r\n---- Begin output of apt-get -q -y install build-essential=11.5ubuntu2.1 ----\r\nSTDOUT: Reading package lists...\r\nBuilding dependency tree...\r\nReading state information...\r\nThe following extra packages will be installed:\r\n  binutils cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6\r\n  libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl\r\n  libc-dev-bin libc6-dev libdpkg-perl libgomp1 libmpc2 libmpfr4 libquadmath0\r\n  libstdc++6-4.6-dev linux-libc-dev make manpages-dev\r\nSuggested packages:\r\n  cpp-doc gcc-4.6-locales debian-keyring g++-multilib g++-4.6-multilib\r\n  gcc-4.6-doc libstdc++6-4.6-dbg gcc-multilib automake1.9 libtool flex gdb\r\n  gcc-doc gcc-4.6-multilib libmudflap0-4.6-dev libgcc1-dbg libgomp1-dbg\r\n  libquadmath0-dbg libmudflap0-dbg binutils-gold glibc-doc libstdc++6-4.6-doc\r\n  make-doc\r\nThe following NEW packages will be installed:\r\n  binutils build-essential cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc\r\n  gcc-4.6 libalgorithm-diff-perl libalgorithm-diff-xs-perl\r\n  libalgorithm-merge-perl libc-dev-bin libc6-dev libdpkg-perl libgomp1 libmpc2\r\n  libmpfr4 libquadmath0 libstdc++6-4.6-dev linux-libc-dev make manpages-dev\r\n0 upgraded, 24 newly installed, 0 to remove and 0 not upgraded.\r\nNeed to get 30.6 MB of archives.\r\nAfter this operation, 83.9 MB of additional disk space will be used.\r\nGet:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libgomp1 amd64 4.6.3-1ubuntu5 [25.5 kB]\r\nGet:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libmpfr4 amd64 3.1.0-3ubuntu2 [201 kB]\r\nGet:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libquadmath0 amd64 4.6.3-1ubuntu5 [126 kB]\r\nGet:4 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libmpc2 amd64 0.9-4 [39.5 kB]\r\nGet:5 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main binutils amd64 2.22-6ubuntu1.1 [2,638 kB]\r\nGet:6 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main libc-dev-bin amd64 2.15-0ubuntu10.5 [83.9 kB]\r\nErr http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main linux-libc-dev amd64 3.2.0-65.98\r\n  403  Forbidden\r\nGet:7 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main libc6-dev amd64 2.15-0ubuntu10.5 [2,941 kB]\r\nGet:8 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main cpp-4.6 amd64 4.6.3-1ubuntu5 [4,836 kB]\r\nErr http://security.ubuntu.com/ubuntu/ precise-security/main linux-libc-dev amd64 3.2.0-65.98\r\n  404  Not Found [IP: 91.189.88.153 80]\r\nGet:9 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main cpp amd64 4:4.6.3-1ubuntu5 [27.6 kB]\r\nGet:10 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main gcc-4.6 amd64 4.6.3-1ubuntu5 [7,572 kB]\r\nGet:11 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main gcc amd64 4:4.6.3-1ubuntu5 [5,114 B]\r\nGet:12 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libstdc++6-4.6-dev amd64 4.6.3-1ubuntu5 [1,660 kB]\r\nGet:13 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main g++-4.6 amd64 4.6.3-1ubuntu5 [6,954 kB]\r\nGet:14 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main g++ amd64 4:4.6.3-1ubuntu5 [1,442 B]\r\nGet:15 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main make amd64 3.81-8.1ubuntu1.1 [119 kB]\r\nGet:16 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main libdpkg-perl all 1.16.1.2ubuntu7.5 [182 kB]\r\nGet:17 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main dpkg-dev all 1.16.1.2ubuntu7.5 [468 kB]\r\nGet:18 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main build-essential amd64 11.5ubuntu2.1 [5,816 B]\r\nGet:19 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main fakeroot amd64 1.18.2-1 [87.2 kB]\r\nGet:20 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libalgorithm-diff-perl all 1.19.02-2 [50.7 kB]\r\nGet:21 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libalgorithm-diff-xs-perl amd64 0.04-2build2 [12.4 kB]\r\nGet:22 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main libalgorithm-merge-perl all 0.08-2 [12.7 kB]\r\nGet:23 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main manpages-dev all 3.35-0.1ubuntu1 [1,671 kB]\r\nFetched 29.7 MB in 1s (21.4 MB/s)\r\nSTDERR: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_3.2.0-65.98_amd64.deb  404  Not Found [IP: 91.189.88.153 80]\r\nE: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?\r\n---- End output of apt-get -q -y install build-essential=11.5ubuntu2.1 ----\r\nRan apt-get -q -y install build-essential=11.5ubuntu2.1 returned 100\r\n```\r\n\r\nWhen I ssh into the half-baked machine and run:\r\n```\r\nubuntu@machine:$ sudo apt-cache policy linux-libc-dev\r\nlinux-libc-dev:\r\n  Installed: (none)\r\n  Candidate: 3.2.0-65.98\r\n  Version table:\r\n     3.2.0-65.98 0\r\n        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages\r\n        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages\r\n     3.2.0-23.36 0\r\n        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages\r\n```\r\nAfter running an `apt-get update`, I get this:\r\n```\r\nubuntu@machine:~$ sudo apt-cache policy linux-libc-dev\r\nlinux-libc-dev:\r\n  Installed: (none)\r\n  Candidate: 3.2.0-67.101\r\n  Version table:\r\n     3.2.0-67.101 0\r\n        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages\r\n        500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages\r\n     3.2.0-23.36 0\r\n        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages\r\n```\r\n\r\n`wget`ting the first package fails, second one succeeds."},"comment":{"url":"https://api.github.com/repos/chef-cookbooks/build-essential/issues/comments/139294387","html_url":"https://github.com/chef-cookbooks/build-essential/issues/41#issuecomment-139294387","issue_url":"https://api.github.com/repos/chef-cookbooks/build-essential/issues/41","id":139294387,"user":{"login":"karcaw","id":663031,"avatar_url":"https://avatars.githubusercontent.com/u/663031?v=3","gravatar_id":"","url":"https://api.github.com/users/karcaw","html_url":"https://github.com/karcaw","followers_url":"https://api.github.com/users/karcaw/followers","following_url":"https://api.github.com/users/karcaw/following{/other_user}","gists_url":"https://api.github.com/users/karcaw/gists{/gist_id}","starred_url":"https://api.github.com/users/karcaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karcaw/subscriptions","organizations_url":"https://api.github.com/users/karcaw/orgs","repos_url":"https://api.github.com/users/karcaw/repos","events_url":"https://api.github.com/users/karcaw/events{/privacy}","received_events_url":"https://api.github.com/users/karcaw/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T16:06:31Z","updated_at":"2015-09-10T16:06:31Z","body":"Please document better how to get build-essential and apt to work properly at compile time, i've tried various fixes and work arounds mentioned here and other places, but chef still tries to do compile build-essential before apt..  i'm working witht the 1.4.X version at this point."}}