[Aptitude-devel] Bug#487887: Aptitude command line "remove" no longer respects packages marked to keep

Manuel A. Fernandez Montecelo manuel.montezelo at gmail.com
Tue Apr 5 22:23:39 UTC 2016


Control: tags -1 + moreinfo


(I haven't looked in detail at the problems described in the merged bug
report #693144 and long messages following it, but keeping in the loop
because of the findings and considerations regarding #487887)


Hi,

2008-06-27 04:50 Daniel Burrows:
>On Wed, Jun 25, 2008 at 05:16:05AM +0800, Telemachus <telemachus at ld.net.au> was heard to say:
>> On the command line, I can no longer remove a package but keep one of
>> the auto-installed dependencies. I could swear that I used to be able
>> to do this:
>>
>> aptitude purge mpd libshout3+

Maybe it depends on the specific examples, but this works for me with
the following example.

I cannot try with libshout3, because it has other rdeps in my system so
it doesn't get removed anyway, but with libnfs8:

  # aptitude -s purge mpd
  The following packages will be REMOVED:
    libadplug-2.2.1-0v5{u} libbinio1v5{u} libnfs8{u} libwildmidi-config{u} libwildmidi1{u} mpd{p}
  0 packages upgraded, 0 newly installed, 6 to remove and 184 not upgraded.
  Need to get 0 B of archives. After unpacking 2,160 kB will be freed.

  Note: Using 'Simulate' mode.
  Do you want to continue? [Y/n/?] n
  Abort.

  # aptitude -s purge mpd libnfs8+
  libnfs8 is already installed at the requested version (1.9.8-1)
  libnfs8 is already installed at the requested version (1.9.8-1)
  The following packages will be REMOVED:
    libadplug-2.2.1-0v5{u} libbinio1v5{u} libwildmidi-config{u} libwildmidi1{u} mpd{p}
  0 packages upgraded, 0 newly installed, 5 to remove and 184 not upgraded.
  Need to get 0 B of archives. After unpacking 1,905 kB will be freed.

  Note: Using 'Simulate' mode.
  Do you want to continue? [Y/n/?] n
  Abort.


>  I thought this used to work as well.  But I think I've found the
>problem in the code, and it goes back to at least 2002.  Can you verify
>that this was working before?  (because I could swear I remember using
>it)  This may be due to the changes last year in how automatic packages
>are handled (although I can't see how).  For my own future reference,
>the problem is that I use an action group to defer computation of, e.g.,
>unused packages, until I'm done applying all the command-line actions.
>That's probably good overall, but it does mean that install commands
>won't cancel unused-removals since the unused-removal hasn't taken
>effect yet.
>
>  Oh, the other thing that I can see that might have affected this is
>the change that caused the "install" operation on a package to not
>affect its automatic flag unless the package was already installed.

I don't know if Daniel Burrows had changed something to make this work
at the time without closing the bug (doesn't look like it, due to the
bug merged later), if something has changed later on fixing this problem
(e.g. in the 0.7 series), if it's an unknown change in libapt that now
causes this to work (e.g. the many changes of apt 1.1), or if it's
erratic and not really fixed.

But in any case...

>  Your suggestion seems like a good idea, but I'm not sure what the
>follow-on consequences would be if I just slapped it in right now.
>However, you can get a similar effect by doing:
>
># aptitude remove mpd "libshout3&m"

I think that this is the best way to solve the situation -- to mark the
packages as manually installed, either within the same action or, if it
doesn't work for some reason (tries to be removed before being marked as
manually installed), in a previous action.

If the package that one wants to preserved is (kept) installed but
marked as automatically installed, it can be removed as a result of the
next run, for example.


Cheers.
-- 
Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>



More information about the Aptitude-devel mailing list