Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt purges are not idempotent #9832

Open
jaymzh opened this issue May 9, 2020 · 0 comments
Open

apt purges are not idempotent #9832

jaymzh opened this issue May 9, 2020 · 0 comments

Comments

@jaymzh
Copy link
Collaborator

jaymzh commented May 9, 2020

Description

When apt does a purge, if any package in the list is installed, it tries to uninstall them all, cfengine2 style.

Chef Version

15.9.17

Platform Version

Ubuntu 18.04

Replication Case

unwanted = [
  'whoopsie',
  'rtkit',
  'speech-dispatcher',
  'speech-dispatcher-audio-plugins',
  'kerneloops-daemon',
  'puppetlabs-release-pc1',
  'puppet',
  'landscape-common',
  'landscape-client',
  'avahi-autoipd',
  'avahi-daemon',
]

package unwanted do
  action :purge
end

Client Output

---- Begin output of ["apt-get", "-q", "-y", "purge", "whoopsie", "rtkit", "speech-dispatcher", "speech-dispatcher-audio-plugins", "kerneloops", "puppetlabs-release-pc1", "puppet", "landscape-common", "landscape-client", "avahi-autoipd", "avahi-daemon"] ----
STDOUT: Reading package lists...
Building dependency tree...
Reading state information...
STDERR: E: Unable to locate package puppetlabs-release-pc1
---- End output of ["apt-get", "-q", "-y", "purge", "whoopsie", "rtkit", "speech-dispatcher", "speech-dispatcher-audio-plugins", "kerneloops", "puppetlabs-release-pc1", "puppet", "landscape-common", "landscape-client", "avahi-autoipd", "avahi-daemon"] ----
Ran ["apt-get", "-q", "-y", "purge", "whoopsie", "rtkit", "speech-dispatcher", "speech-dispatcher-audio-plugins", "kerneloops", "puppetlabs-release-pc1", "puppet", "landscape-common", "landscape-client", "avahi-autoipd", "avahi-daemon"] returned 100

In this case one of the packages (landscape-common) was there so it needed to be removed, however, it tried uninstalling all of them as you can see above. Turns out that one of those packages isn't on the repos and thus apt barfed.

# dpkg -l 'whoopsie' 'rtkit' 'speech-dispatcher' 'speech-dispatcher-audio-plugins' 'kerneloops-daemon' 'puppetlabs-release-pc1' 'puppet' 'landscape-common' 'landscape-client'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                                    Version                                  Architecture                             Description
+++-=======================================================================-========================================-========================================-===================================================================================================================================================
ii  landscape-common                                                        18.01-0ubuntu3.4                         amd64                                    Landscape administration system client - Common files
dpkg-query: no packages found matching whoopsie
dpkg-query: no packages found matching rtkit
dpkg-query: no packages found matching speech-dispatcher
dpkg-query: no packages found matching speech-dispatcher-audio-plugins
dpkg-query: no packages found matching kerneloops-daemon
dpkg-query: no packages found matching puppetlabs-release-pc1
dpkg-query: no packages found matching puppet
dpkg-query: no packages found matching landscape-client
@jaymzh jaymzh added Status: Untriaged An issue that has yet to be triaged. Platform: Linux Priority: Critical Fix immediately labels May 9, 2020
@dheerajd-msys dheerajd-msys self-assigned this May 11, 2020
@lamont-granquist lamont-granquist removed the Status: Untriaged An issue that has yet to be triaged. label Jun 25, 2020
@tas50 tas50 added Focus: Resources and removed Priority: Critical Fix immediately labels May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants