sous-chefs / apt Goto Github PK
View Code? Open in Web Editor NEWDevelopment repository for the apt cookbook
Home Page: https://supermarket.chef.io/cookbooks/apt
License: Apache License 2.0
Development repository for the apt cookbook
Home Page: https://supermarket.chef.io/cookbooks/apt
License: Apache License 2.0
I was trying to setup https://launchpad.net/~chris-lea/+archive/ubuntu/python-geoip2 ppa but getting following error:
Error executing action add
on resource 'apt_repository[ppa:chris-lea/python-geoip2]'
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
file[/etc/apt/sources.list.d/ppa:chris-lea/python-geoip2.list](/tmp/kitchen/cache/cookbooks/apt/providers/repository.rb line 132) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/apt/sources.list.d/ppa:chris-lea does not exist.
As I google solutions, I found a cookbook (https://github.com/sometimesfood/chef-apt-repo) providing simple way to setup individually hosted ppa from launchpad like following:
ppa "launchpad-username/ppa-name"
source code is here :https://github.com/sometimesfood/chef-apt-repo/blob/master/definitions/ppa.rb
It would be beneficial to add this to official community cookbook.
================================================================================
Error executing action `install` on resource 'package[update-notifier-common]'
================================================================================
Chef::Exceptions::Package
-------------------------
update-notifier-common has no candidate in the apt-cache
Resource Declaration:
---------------------
# In /tmp/kitchen/cache/cookbooks/apt/recipes/default.rb
68: package 'update-notifier-common' do
69:notifies :run, 'execute[apt-get-update]', :immediately
70:only_if { apt_installed? }
71: end
72:
Seems like package update-notifier-common has been removed.
Or I missed something?
Debian
If some of your apt_repository 'foo' do
blocks are critical (any failure should fail the entire run), but others are non-critical (OK to ignore), you have to choose to either fail when you don't need to or continue when you wanted to fail.
apt_repository 'juju' do
uri 'http://ppa.launchpad.net/juju/stable/ubuntu'
components ['main']
distribution 'trusty'
key 'C8068B11'
keyserver 'keyserver.ubuntu.com'
action :add
deb_src true
ignore_failure true
end
apt_repository 'cloudera' do
uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'
arch 'amd64'
distribution 'precise-cdh4'
components ['contrib']
key 'http://archive.cloudera.com/debian/archive.key'
ignore_failure false
end
A failure to add the juju repo shouldn't fail the build, while a failure to add the cloudera repo should.
There are [pretty important] bug fixes that have been in here since March and still aren't available in the supermarket. Particularly 9f69c17 without which apt
cannot handle expired keys (and consequently bails).
We just added a new apt_update resource which will need a matcher
The example for apt_repository
that adds 'nginx-php' should be updated. The URI specified (http://ppa.launchpad.net/nginx/php5/ubuntu) is not available and gives a 404.
It would be easier to figure out how to use apt_repository
by starting from a working example.
I recently noticed that I'm getting lots of these warnings when using the apt cookbook:
[2015-09-22T21:35:22+00:00] WARN: You declared a new resource #<Class:0x0000000641b418> for resource apt_preference, but it comes alphabetically after LWRP resource apt_preference from cookbook apt and has the same filters ({}), so it will not be used. Use override: true if you want to use it for apt_preference.
[2015-09-22T21:35:22+00:00] WARN: AptPreference already exists! Deprecation class overwrites LWRP resource apt_preference from cookbook apt
[2015-09-22T21:35:22+00:00] WARN: You declared a new resource #<Class:0x00000006412368> for resource apt_repository, but it comes alphabetically after LWRP resource apt_repository from cookbook apt and has the same filters ({}), so it will not be used. Use override: true if you want to use it for apt_repository.
[2015-09-22T21:35:22+00:00] WARN: AptRepository already exists! Deprecation class overwrites LWRP resource apt_repository from cookbook apt
This is using Chef 12.4.1 with chef zero provisioner, happening during a chefspec run
I'm trying to get this plugin working for Ubuntu 14.04 trusty.
I suppose my question is, why is chef complaining about /etc/apt/sources.list.d/nginx.list
when the docs at nginx tell you to format the etc/apt/sources.list
?
This is the code from my recipe:
apt_repository 'nginx' do
uri 'http://nginx.org/packages/ubuntu/'
key 'http://nginx.org/keys/nginx_signing.key'
distribution 'trusty'
deb_src true
action :add
end
apt_package "nginx" do
provider Chef::Provider::Package::Apt
action :install
end
And here is the error message from chef:
* execute[apt-get update] action run[2014-10-31T15:45:40+00:00] ERROR: execute[apt-get update] (/tmp/kitchen/cookbooks/apt/providers/repository.rb line 156) had an error: Expected process to exit with [0], but received '100'
---- Begin output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
STDOUT:
STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
E: The list of sources could not be read.
---- End output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
Ran apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' returned 100; ignore_failure is set, continuing
================================================================================
Error executing action `run` on resource 'execute[apt-get update]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
STDOUT:
STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
E: The list of sources could not be read.
---- End output of apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' ----
Ran apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0' returned 100
Resource Declaration:
---------------------
# In /tmp/kitchen/cookbooks/apt/providers/repository.rb
156: execute 'apt-get update' do
157: command "apt-get update -o Dir::Etc::sourcelist='sources.list.d/#{new_resource.name}.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'"
158: ignore_failure true
159: action :nothing
160: notifies :run, 'execute[apt-cache gencaches]', :immediately
161: end
162:
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cookbooks/apt/providers/repository.rb:156:in `block in class_from_file'
execute("apt-get update") do
action [:nothing]
ignore_failure true
retries 0
retry_delay 2
command "apt-get update -o Dir::Etc::sourcelist='sources.list.d/nginx.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'"
backup 5
returns 0
cookbook_name :"touchbistro-rails"
end
Recipe: touchbistro-rails::newrelic_nginx_agent
================================================================================
Error executing action `install` on resource 'apt_package[nginx]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of apt-cache policy nginx ----
STDOUT:
STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
E: The list of sources could not be read.
E: The package lists or status file could not be parsed or opened.
---- End output of apt-cache policy nginx ----
Ran apt-cache policy nginx returned 100
---------------------
# In /tmp/kitchen/cookbooks/touchbistro-rails/recipes/newrelic_nginx_agent.rb
23: apt_package "nginx" do
24: provider Chef::Provider::Package::Apt
25: action :install
27:
Compiled Resource:
------------------
# Declared in /tmp/kitchen/cookbooks/touchbistro-rails/recipes/newrelic_nginx_agent.rb:23:in `from_file'
apt_package("nginx") do
provider Chef::Provider::Package::Apt
action [:install]
retries 0
retry_delay 2
package_name "nginx"
cookbook_name :"touchbistro-rails"
recipe_name "newrelic_nginx_agent"
end
- reload service service[nginx]
* service[nginx] action restart
- restart service service[nginx]
Running handlers:
[2014-10-31T15:45:40+00:00] ERROR: Running exception handlers
Running handlers complete
Chef Client failed. 87 resources updated in 631.862846189 seconds
[2014-10-31T15:45:40+00:00] ERROR: apt_package[nginx] (touchbistro-rails::newrelic_nginx_agent line 23) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100'
---- Begin output of apt-cache policy nginx ----
STDOUT:
STDERR: E: Malformed line 1 in source list /etc/apt/sources.list.d/nginx.list (dist parse)
E: The list of sources could not be read.
E: The package lists or status file could not be parsed or opened.
---- End output of apt-cache policy nginx ----
Ran apt-cache policy nginx returned 100
[2014-10-31T15:45:40+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
I am receiving the above error when trying to key the key_proxy in an apt-repository using the apt cookbook. Please let me know what debugging information you need to troubleshoot the issue. Thanks!
According to github the last release was 'v2.3.10.' However supermarket and the tags suggest the latest version if 2.6.0.
If you look here, you'll see package mailutils being set:
https://github.com/opscode-cookbooks/apt/blob/master/recipes/unattended-upgrades.rb#L32
However, if you fetch apt cookbook through https://supermarket.getchef.com, you'll see the package resource is not there.
Both are apt cookbook version 2.6.0.
This seems like a version bump or cookbook upload gone wrong or something? Or how does this work?
Running the default recipe on a Windows node isn't a no-op - it tries to create the /etc/apt/apt.conf.d/10recommends
file and explodes with:
Chef::Exceptions::Win32APIError
-------------------------------
No mapping between account names and security IDs was done.
---- Begin Win32 API output ----
System Error Code: 1332
System Error Message: No mapping between account names and security IDs was done.
---- End Win32 API output ----
I'm guessing it's because this part of the recipe is missing the only_if { apt_installed? }
guard.
template '/etc/apt/apt.conf.d/10recommends' do
owner 'root'
group 'root'
mode '644'
source '10recommends.erb'
end
The following recipe creates the following apt repository
apt_repository 'sbt' do
uri 'https://dl.bintray.com/sbt/debian /'
key '642AC823'
keyserver 'keyserver.ubuntu.com'
action :add
end
deb "https://dl.bintray.com/sbt/debian /"
However this is not a valid repository because of the double quotes.
root@default-ubuntu-1404:~# apt-get update
E: Malformed line 1 in source list /etc/apt/sources.list.d/sbt.list (dist)
E: The list of sources could not be read.
Manually editing the /etc/sources.d/apt/sbt.list to look like the following fixes the problem.
deb https://dl.bintray.com/sbt/debian /
How can I make the cookbook not add the double quotes?
Additional information
http://www.scala-sbt.org/0.13/tutorial/Installing-sbt-on-Linux.html
If the unattended_upgrades
package is already installed, the debconf seed never gets seeded and auto-updates will never get enabled:
https://github.com/chef-cookbooks/apt/blob/master/recipes/unattended-upgrades.rb#L27
Systems initially provisioned by cloud-init
(like recently at DigitalOcean) already have unattended_upgrades
installed and auto-update disabled.
WARN: Cloning resource attributes for file[/etc/apt/preferences.d/my_packages.pref] from prior resource (CHEF-3694)
I'm using the following
apt_preference 'my_packages' do glob '*' pin 'repo.mypackages.com' pin_priority '700' end
apt:default intentionally does not run apt-get update if /var/lib/apt/periodic/update-success-stamp is present.
This can be a bit of a problem if a system is being bootstrapped for the first time and apt-get update has not been run in some time. This can often be the case with hosted providers such as digital ocean.
$ date
Sun Feb 1 14:34:12 PST 2015
$ cd /var/lib/apt/periodic
$ ls -al update-success-stamp
-rw-r--r-- 1 root root 0 Jan 8 13:33 update-success-stamp
The cacher-client recipe fails to compile if:
apt::default must be in the run_list before apt::cacher-client, but this executes apt-get update
without the proxy.
Recipe: apt::cacher-client
* template[/etc/apt/apt.conf.d/01proxy] action create
================================================================================
Recipe Compile Error in .../cookbooks/apt/recipes/cacher-client.rb
================================================================================
Chef::Exceptions::ResourceNotFound
----------------------------------
resource template[/etc/apt/apt.conf.d/01proxy] is configured to notify
resource execute[apt-get update] with action run, but
execute[apt-get update] cannot be found in the resource collection.
template[/etc/apt/apt.conf.d/01proxy] is defined in
/var/chef/cache/cookbooks/apt/recipes/cacher-client.rb:60:in `from_file'
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/apt/recipes/cacher-client.rb:73:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/apt/recipes/cacher-client.rb:
66: :proxy => cacher_ipaddress,
67: :port => servers[0]['apt']['cacher_port'],
68: :bypass => node['apt']['cache_bypass']
69: )
70: action(node['apt']['compiletime'] ? :nothing : :create)
71: notifies :run, 'execute[apt-get update]', :immediately
72: end
73>> t.run_action(:create) if node['apt']['compiletime']
74: else
75: Chef::Log.info('No apt-cacher-ng server found.')
76: file '/etc/apt/apt.conf.d/01proxy' do
77: action :delete
78: end
79: end
80:
81: include_recipe 'apt::default'
82:
Hello. I am using the apt cookbook in one of my cookbooks. Whenever I am running the cookbook against Test Kitchen, I am receiving the "undefined method 'start_with?' for nil:NilClass" error.
On chef version 10.18.0-1 OS Ubuntu 12.04.1 LTS I'm getting the following error:
[Thu, 08 Oct 2015 17:12:22 +0500] ERROR: Running exception handlers
[Thu, 08 Oct 2015 17:12:22 +0500] FATAL: Saving node information to /var/cache/chef/failed-run-data.json
[Thu, 08 Oct 2015 17:12:22 +0500] ERROR: Exception handlers complete
[Thu, 08 Oct 2015 17:12:22 +0500] ERROR: SyntaxError: compile error
/var/cache/chef/cookbooks/apt/providers/repository.rb:56: syntax error, unexpected ':', expecting ')'
...Mixlib::ShellOut.new(cmd, env: { 'LANG' => 'en_US', 'LANGUAG...
^
/var/cache/chef/cookbooks/apt/providers/repository.rb:56: syntax error, unexpected ')', expecting kEND
/var/cache/chef/cookbooks/apt/providers/repository.rb:69: syntax error, unexpected ':', expecting ')'
...Mixlib::ShellOut.new(cmd, env: { 'LANG' => 'en_US', 'LANGUAG...
^
/var/cache/chef/cookbooks/apt/providers/repository.rb:69: syntax error, unexpected ')', expecting kEND
[Thu, 08 Oct 2015 17:12:22 +0500] FATAL: Stacktrace dumped to /var/cache/chef/chef-stacktrace.out
[Thu, 08 Oct 2015 17:12:22 +0500] ERROR: Sleeping for 1800 seconds before trying again
Hi guys, I'm unable to install version 2.6.1 because metadata.rb is missing, see: https://supermarket.chef.io/cookbooks/apt/versions/2.6.1#foodcritic
Commit 818ae9f added install of apt-transport-https with no guard. This cookbooks default recipe is included by many other cookbooks and this breaks the chef run when pulling in version 2.9.1 of this cookbook.
Hi there,
I've encountered a problem when my package names got a dot in their name. apt-get will ignore the pin file with this notice:
N: Ignoring file 'my-package.1.0-final' in directory '/etc/apt/preferences.d/' as it has an invalid filename extension
I would suggest to add the extension .pref at the end of the package filename, if there is a dot in the name. This would still support backward compatibility, as package names without dot will not be changed.
What do you think? If you like I can prepare a PR, but wanted to check first if this should be covered by the apt-cookbook or the application wrapper cookbook.
Cheers,
Jan
2.8.1
NoMethodError
-------------
undefined method `tr' for nil:NilClass
Cookbook Trace:
---------------
/home/rmoriz/chef-solo/cookbooks-2/apt/providers/preference.rb:32:in `safe_name'
/home/rmoriz/chef-solo/cookbooks-2/apt/providers/preference.rb:77:in `block in class_from_file'
Resource Declaration:
---------------------
43: apt_preference 'nginx' do
44: action :remove
45: end
See: chef/supermarket#528 for more details.
distribution node['lsb']['codename']
not the default with an option to remove it?keyserver 'keyserver.ubuntu.com'
instead of going to a template?Sometimes, for whatever reasons, apt-get update
fails. This might be caused by mirrors that are updated right in the moment when apt-get update
was executed or due to network issues. Usually this later causes various obscure problems like "WARNING: The following packages cannot be authenticated!" and crash the chef run.
I suggest to implement some shell logic to retry apt-get update
if it fails (retries: attribute, maybe 3?) in all resources that have the command 'apt-get update'`.
I'm also not sure if the ignorance of errors (ignore_failure true
) is a good idea, but at least a retry would probably reduce errors a lot.
The Debian/Ubuntu autopkgtest maintainers had the same issue and implemented a very simple static solution: http://anonscm.debian.org/cgit/autopkgtest/autopkgtest.git/diff/?id=7f667754
The name attribute :repo_name
defined in repository resource is not actually used in the provider class. I found this confusing since the attribute is documented in the README.md.
There is pull request โ #81
And I want to get any answer for my messages.
But i tired to get email from "bot named Curry".
You can see that I have already signed ICLA and authorized to contribute โ https://supermarket.getchef.com/users/alukardd
The removal of the following block (last appeared in 2.3.10) has broken several cookbooks that rely on hooking this event in their recipes. I found out the hard way after installing a newer cookbook that depends on apt. I was able to fix the issue by pinning to 2.3.x in my environment, but its worth mentioning since many cookbook developers do not pin the cookbook versions in their metadata.
What was the reason for the removal?
# For other recipes to call to force an update
execute 'apt-get update' do
command 'apt-get update'
ignore_failure true
only_if { apt_installed? }
action :nothing
end
I've report a bug on another cookbooks and it seems it comes from this one.
chef/chef#2866
Could you take a look ?
unattended-upgrades
has two ways to limit the scope of sources that will be considered for automatic upgrades
Unattended-Upgrade::Allowed-Origins
This is currently implemented in this cookbook, but allows only the specification of one or more "origin:archive" scopes.
Unattended-Upgrade::Origins-Pattern
This is currently not implemented but allows a much more flexible configuration, like:
Unattended-Upgrade::Origins-Pattern {
"origin=Google\, Inc.,suite=contrib";
"site=www.example.com,component=main";
};
see:
https://github.com/mvo5/unattended-upgrades
https://github.com/mvo5/unattended-upgrades/blob/debian/jessie/data/50unattended-upgrades.Debian
We want to auto-upgrade only security upgrades. Debian, contrary to Ubuntu, does not use a specifc archive name. All security updates are part of the "stable" archive hence Unattended-Upgrade::Allowed-Origins
has no way to limit the scope to security updates.
Unattended-Upgrade::Origins-Pattern
Looks like support was added in Debian 7.
It would be nice to get why-run on this LWRP
In the repository provider, install_key_from_keyserver
will accept a key starting with "0x" and install it successfully with the apt-key
command but the logic in the not_if
guard will fail causing it to be installed on every Chef run.
end_with?
check?ea17f0b introduced a potential backwards compatibility break when using the apt_repository lwrp.
Before, the full protocol and port were required to be defined (only when no proxy was used it seems), now that they are automatically added this is causing duplicate protocols and ports to be added causing converge failures.
I was running version 2.7.0 of the apt cookbook with this code in one of my cookbooks
#Add the Jenkins repo
apt_repository 'jenkins' do
uri 'http://pkg.jenkins-ci.org/debian binary/'
key 'https://jenkins-ci.org/debian/jenkins-ci.org.key'
notifies :run, 'execute[apt-refresh]', :immediately
end
Now a berks update to apt 2.8.1 gives me malformed sources.list files such as the below output of my jenkins.list
deb "http://pkg.jenkins-ci.org/debian binary/"
This results in a "Malformed line 1 in source list /etc/apt/sources.list.d/jenkins.list (dist parse)" error. This cookbook worked before the version update, and this repo already functioned on this server properly before the apt cookbook updated. What can be done to correct this? It overwrote a functioning repo and completely broke apt.
Edit: I'd like to add that the jenkins.list file used to look and work like this:
deb http://pkg.jenkins-ci.org/debian binary/
With the latest sources I get
ERROR: cookbook_file[/etc/apt/apt.conf.d/15update-stamp](apt::default line 53) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /etc/apt/apt.conf.d does not exist.
It used to work until a week ago or so
The CONTRIBUTING file refers to the old JIRA issues requirements, it needs to be changed or removed at all.
the debian-cookbook sets package_name '*'
in apt/preferences. The regex validation in apt/resources/preference.rb for the attribute package_name
does not allow this.
I am trying to unset flags in a package install. My command:
package "apache2-utils" do
action :install
options '--force=yes'
end
Output from the run:
---- Begin output of apt-get -q -y --force=yes install apache2-utils=2.4.7-1ubuntu4.8 ----
STDERR: E: Command line option --force=yes is not understood
---- End output of apt-get -q -y --force=yes install apache2-utils=2.4.7-1ubuntu4.8 ----
Ran apt-get -q -y --force=yes install apache2-utils=2.4.7-1ubuntu4.8 returned 100
What i need to do is apt-get -q --force=yes since apt-get seems to be getting confused if it has both -y and --force=yes. So how do I unset the -y, none of the documentation seems to say and the -q -y seems to be a default.
Thoughts?
If a package signing key expires, the repository provider never attempts to obtain a renewed key, due to the guard in recipes/repository.rb:
not_if do
extract_fingerprints_from_cmd('apt-key finger').any? do |fingerprint|
fingerprint.end_with?(key.upcase)
end
end
This guard needs to return false
if the key has expired.
I get a 404 when clicking on the gitter icon/link in the README.md.
The documentation appears to indicate that apt_repository LWRP accepts an attribute parameter named key_proxy
. It does not and trying to do so produces the expected error:
ERROR: undefined method
key_proxy' for Chef::Resource::AptRepository`
You can use a proxy by setting the node['apt']['key_proxy']
attribute; you just can't pass the attribute directly to the apt_repository LWRP.
At a minimum, the documentation should be updated but, ideally, the apt_repository should be enhanced to accept the key_proxy
parameter.
It would be nice to be able to specify sensitive
attribute with apt_repository
so that it will be handed down to the underlying file
resource. Sometimes you need to add user and password when having to setup a vendor repository that used simple HTTP authentication. Hiding these would be a splendid feature to have.
Let me know @thommay, if you fancy a pull request for this.
extract_fingerprints_from_cmd
extracts keys by matching the string Key fingerprint but commands such as apt-key finger
or gpg --with-fingerprint
will output a different string if LANG is not set to english. For example, in a system configured with LANG=es_ES the actual string is Huella de clave, and so the function always returns an empty list, which causes new keys not being installed.
Some discussion here: http://security.stackexchange.com/questions/74009/what-is-an-openpgp-key-id-collision
With a link to the key take away at: http://tools.ietf.org/html/rfc4880#section-3.3
The long IDs already work fin but it would be nice to start throwing a warning message when the apt_repository
resource is used with a short ID.
setup is that i had /etc/apt/soures.list.d/mono.list
created, and added a key to it.
the first run it actually adds the new key via apt-key adv
but explodes with "package cannot be authenticated!" error:
* apt_repository[mono] action add
* execute[install-key 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF] action run
- execute apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
* ruby_block[validate-key 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF] action run (skipped due to not_if)
* file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing)
* execute[apt-cache gencaches] action nothing (skipped due to action :nothing)
* execute[apt-get update] action nothing (skipped due to action :nothing)
* file[/etc/apt/sources.list.d/mono.list] action create (up to date)
* apt_update[grrr] action periodic (up to date)
* apt_package[git, inotify-tools, librsvg2-bin, libxml2-dev, libxslt1-dev, lua5.1, liblua5.1-0-dev, luarocks, mono-complete, mono-devel, pkg-config, python, python-dev, python-pip, python-virtualenv, texlive-fonts-recommended, texlive-latex-base, texlive-latex-extra, texlive-latex-recommended, librsvg2-bin, unzip, wget, zip, zsh, zlib1g-dev] action upgrade
================================================================================
Error executing action `upgrade` on resource 'apt_package[git, inotify-tools, librsvg2-bin, libxml2-dev, libxslt1-dev, lua5.1, liblua5.1-0-dev, luarocks, mono-complete, mono-devel, pkg-config, python, python-dev, python-pip, python-virtualenv, texlive-fonts-recommended, texlive-latex-base, texlive-latex-extra, texlive-latex-recommended, librsvg2-bin, unzip, wget, zip, zsh, zlib1g-dev]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '100'
---- Begin output of apt-get -q -y install mono-complete=4.2.2.30-0xamarin2 mono-devel=4.2.2.30-0xamarin2 ----
[....]
WARNING: The following packages cannot be authenticated!
mono-complete libmono-c5-1.1-cil libmono-cairo4.0-cil
[...]
then i nuked the mono.list file thinking "shitty code, doesn't add the key if the sources file exists" (which i could have seen was the incorrect conclusion to jump to if i'd read the output closer, but its still before noon for me). but then it works:
* apt_repository[mono] action add
* execute[install-key 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF] action run (skipped due to not_if)
* ruby_block[validate-key 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF] action run (skipped due to not_if)
* file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing)
* execute[apt-cache gencaches] action nothing (skipped due to action :nothing)
* execute[apt-get update] action nothing (skipped due to action :nothing)
* file[/etc/apt/sources.list.d/mono.list] action create
- create new file /etc/apt/sources.list.d/mono.list
- update content in file /etc/apt/sources.list.d/mono.list from none to efc271
(diff output suppressed by config)
- change mode from '' to '0644'
- change owner from '' to 'root'
- change group from '' to 'root'
* file[/var/lib/apt/periodic/update-success-stamp] action delete
- delete file /var/lib/apt/periodic/update-success-stamp
* execute[apt-get update] action run
- execute apt-get update -o Dir::Etc::sourcelist='sources.list.d/mono.list' -o Dir::Etc::sourceparts='-' -o APT::Get::List-Cleanup='0'
* execute[apt-cache gencaches] action run
- execute apt-cache gencaches
* apt_update[grrr] action periodic (up to date)
* apt_package[git, inotify-tools, librsvg2-bin, libxml2-dev, libxslt1-dev, lua5.1, liblua5.1-0-dev, luarocks, mono-complete, mono-devel, pkg-config, python, python-dev, python-pip, python-virtualenv, texlive-fonts-recommended, texlive-latex-base, texlive-latex-extra, texlive-latex-recommended, librsvg2-bin, unzip, wget, zip, zsh, zlib1g-dev] action upgrade
- upgrade package mono-complete from 3.2.8+dfsg-4ubuntu1.1 to 4.2.2.30-0xamarin2
- upgrade package mono-devel from 3.2.8+dfsg-4ubuntu1.1 to 4.2.2.30-0xamarin2
it skips adding the keys, the mono.list didn't change, i just nuked it before running it again. i'm speculating that apt-cache gencaches
need to be run or something.
Adding a repository via apt_repository
triggers an apt-get update to be executed which only includes the newly added source list. The documentation could be misleading as it states that execute[apt-get-update]
is triggered immediately. An additional note in the documentation might be helpful to point out the implications of the partial update that is triggered by apt_repository
. It is still necessary to add apt
to the first position of the run-list when adding repositories.
This partial update touches /var/lib/apt/periodic/update-success-stamp
and /var/lib/apt/periodic/update-stamp
. As a result helpers.rb/apt_up_to_date?
returns true even though only a partial update has been done and the rest of the index might be outdated.
In some cases this can lead to unexpected issues, as demonstrated in the example below:
apt_repository "nodejs" do
uri "https://deb.nodesource.com/node"
distribution node['lsb']['codename']
components ["main"]
key "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
end
include_recipe 'apt'
package nginx
package nodejs
The example above might fail due to an outdated index which won't be updated. Apt-get might attempt to install a package version which no longer exists (currently the case on ec2 ubuntu 14.04 instances).
If the repository has already been added in an early invocation of chef-client, adding a key to the resource does not work.
The repository must first be removed and then chef must be re-run for the key to be added.
I was trying to install tmux 1.9a on some Ubuntu 14.04 machines and wrote
apt_repository 'tmux PPA' do
uri 'ppa:pi-rho/dev'
distribution node['lsb']['codename']
end
package 'tmux'
it wasn't working, and when I manually ran apt-get update
the PPA wasn't even in the output and I couldn't figure out why;
changing apt_repository 'tmux PPA'
to apt_repository 'tmux_ppa'
fixed the issue (I didn't originally realize it was gonna get used as the file name in /etc/sources.list.d/
and that apt would silently ignore it with spaces)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.