apt-get autoremove don't find all packages

Bug #667468 reported by Removed by request
8
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: apt

I'm using Ubuntu 11.04 dev and apt 0.8.7ubuntu1. apt-get autoremove don't find all unused packages. For example if I install alsa-utils, linux-sound-base is installed as a needed package. If I try to autoremove alsa-utils, linux-sound-base is ignored. Only a second autoremove does remove linux-sound-base. I have made an example (it's in german because I don't know how to start apt in english but it should show the problem with the commands).

Revision history for this message
Removed by request (removed3425744) wrote :
Revision history for this message
Removed by request (removed3425744) wrote :
Revision history for this message
Torsten Spindler (tspindler) wrote :

Thanks for taking the time to report this bug. I fear that apt-get does not do the autoremove after the purge. I will mark this a wishlist bug, as the work around to use first the purge and then the autoremove is straight forward.

Changed in apt (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Removed by request (removed3425744) wrote :

The bug appears even without --purge. sudo apt-get autoremove alsa-utils will ignore linux-sound-base too. Only a sudo apt-get autoremove after the first command will find the package.

Revision history for this message
Julian Andres Klode (juliank) wrote :

autoremove takes no arguments. You must remove the package first, and then run autoremove to remove unused packages.

Changed in apt (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Removed by request (removed3425744) wrote :

The argument doesn't change the behaviour. Even first removing the package and then doing an autoremove leads to the same error.

Changed in apt (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Removed by request (removed3425744) wrote :

I have tested this with apt 0.9.7.5ubuntu2 and a few packages but every time apt-get autoremove _packagename_ has found all packages which an apt-get remove _packagename_; apt-get autoremove would find.

Changed in apt (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Daniel Hartwig (wigs) wrote :

[Clarification for future bug archaeologists]

Invalid – as per comment from juliank (hint: maintainer). There was no fix released to address this report because a bug was never identified.

Assuming use of the correct, documented commands:
# apt-get remove PKG
# apt-get autoremove

not enough information is presented about the packages involved to determine whether a bug is present. The maintainer does not think so.

It is well known that installing a package may bring in more dependencies than can be automatically removed later. Some of the dependencies may satisfy Suggests or Recommends of another package, or an or-group dependency (“Depends: libfoo | libbar”). In any of those cases, apt can not auto-remove a package simply because the package which directly caused it's installation is no longer installed.

[Comments for the submitter]

Sworddragon, with respect to your diligence in filing reports and to maintaining your previous reports (many submitters do not :-), please kindly note these three points for the future:

Do not confirm your own reports. If the maintainer/bug supervisor/etc. has marked it invalid and you strongly disagree, then mark it new. Do so even if it was previously confirmed (in this case the original confirmation was incorrect since the report requires more information).

If you no longer experience an issue but can not identify where it was fixed (i.e. the particular changelog entry) then mark it as either incomplete or invalid. In this case it is not clear that there ever was a bug so there can hardly have been a fix released for it.

Above all, absolutely do continue to file reports and keep them updated. This is greatly appreciated.

King regards

Revision history for this message
Removed by request (removed3425744) wrote :

> not enough information is presented about the packages involved to determine whether a bug is present. The maintainer does not think so.

Too bad I haven't knewed on reporting this bug how to set the locale to an english one because I was new to Linux this time. But even if the maintainer can't clarify this report as a real bug it doesn't mean that it isn't one. I have checked my attached log again and am sure that this was definitely a bug. I will explain it again:

"apt-get autoremove alsa-utils" has tried only to remove alsa-utils. Using directly after this "apt-get autoremove" has tried to remove linux-sound-base (--purge was not needed for this. I don't know why I have used it in the log). So linux-sound-base wasn't any recommended or suggested package on my system. Theoretically the first command "apt-get autoremove alsa-utils" should remove alsa-utils and find all dependencies that are not recommended and not suggested to any other installed package of my system and remove them. But apt hasn't done this.

This all is now ~2 years ago and the dependencies of alsa-utils has changed so that I had to test it with other packages and apt-get autoremove PKG will work as expected: It removes the given package and does an autoremove after this.

> If you no longer experience an issue but can not identify where it was fixed (i.e. the particular changelog entry) then mark it as either incomplete or invalid. In this case it is not clear that there ever was a bug so there can hardly have been a fix released for it.

It seems nobody has tried to fix this bug directly because he saw this ticket. I have seen often tickets which was miraculous fixed after a while. This is nothing special because some bugs are randomy fixed with a commit. And in ~2 years there were surely many commits released which had the chance to randomly fix this issue.

Revision history for this message
Daniel Hartwig (wigs) wrote : Re: [Bug 667468] Re: apt-get autoremove don't find all packages

I have some final comments, I don't wish to start a dialog here since
there is a non-issue and I am glad for it to be closed.

On 19 September 2012 13:41, Sworddragon <email address hidden> wrote:
> This all is now ~2 years ago and the dependencies of alsa-utils has
> changed so that I had to test it with other packages and apt-get
> autoremove PKG will work as expected: It removes the given package and
> does an autoremove after this.

Please check the man page for apt-get which documents that
“autoremove” takes no arguments. You can not expect “apt-get
autoremove PKG" to do anything other than report an error: takes no
arguments.

… but readers of the report understood your point, that you expected:

# apt-get remove PKG
# apt-get autoremove

to remove all packages which were auto-installed by:

# apt-get install PKG

There are good reasons why this is not so. The issue has been
reported several times and it is almost never a bug.

> It seems nobody has tried to fix this bug directly because he saw this
> ticket.

It is not clear there is a bug.

1. You try to use “autoremove PKG” which is not documented, therefore
can not be a bug.
2. We need to know the state of related packages on the system in
question to know whether the real “remove PKG && autoremove” should
have removed linux-sound-base or not. This is no longer possible due
to the age of the report.

> I have seen often tickets which was miraculous fixed after a
> while. This is nothing special because some bugs are randomy fixed with
> a commit. And in ~2 years there were surely many commits released which
> had the chance to randomly fix this issue.

Indeed. However the difference is that knowing a bug has been fixed
is not the same as no longer being able to reproduce it, which is the
case here.

I just ask you to keep this in mind when closing reports. If you can
not reproduce: incomplete or invalid. If you can identify when it was
fixed (changelog entry): fix released.

Revision history for this message
Removed by request (removed3425744) wrote :

This would be easier if we could choose "Works for me" as a solution. But your information is giving me a hint that there is another bug/missing documentation in apt but I will open a new ticket for this.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers