Le 31/05/2024, "Thomas Schmitt" <scdbac...@gmx.net> a écrit:

> Then it offered me a list with slightly frightening wildcards:
>
>   The following packages will be REMOVED:
>     fuse* libreoffice-avmedia-backend-gstreamer* linux-image-4.19.0-17-amd64*
>     linux-image-4.19.0-20-amd64* linux-image-4.19.0-9-amd64* python*
>     python-twisted-core* wicd-daemon* wicd-gtk*

AFAIK, these are not wildcards; each star appended to a package name
indicates that the package is going to be purged (no config files left
afterwards), as opposed to simply removed (leaving configuration files
in place).

> I will probably run "apt autoremove" after verifying that the few
> worthy local packages are not in the list proposed for autoremoval.

tl;dr: aptitude praise
~~~~~~~~~~~~~~~~~~~~~~

FWIW, removal of “obsolete or local” packages is easily done
interactively in aptitude: you go the the corresponding section of the
main screen, hit Enter, etc. The [ key recursively unfolds a section
(use ] to fold it back). You ask to purge a package by typing _
(removing with -, as in the venerable dselect).

For actually obsolete packages, doing so will occasionally trigger a
“dependency problem” because another package that depends on it hasn't
been marked as “to be removed or purged” yet. But normally, that other
package is also obsolete, so it *will* be marked shortly after when you
get to it. So basically, once you've gone through all the obsolete
packages marking each one as “to be purged”, having only left intact the
local ones you do want to keep, there should be no dependency problem to
resolve. ⇒ Hit g (for “go”), check the preview, hit g again if it looks
fine, otherwise q.

Note that the preview (of what is going to be done) is shown in a new
tab (yes, these are tabs, you can switch between them with F6), and that
tab gets closed if you cancel the operation with q. Also, you can act
directly in the Preview tab to unmark an operation, etc. And you can
undo with Ctrl-u, including outside the Preview tab.

Generally and especially for this kind of use (removing obsolete
packages that are still installed), I find that the following lines are
a must-have in /etc/apt/apt.conf:

  // Similar to dselect
  Aptitude::UI::Advance-On-Action "true";

(I also like “Aptitude::Auto-Upgrade "true";” but it is irrelevant
here.)

apt and aptitude have different algorithms for handling upgrades, so:
for stable-to-next-stable upgrades, I do stick to what the Release Notes
recommend. In most other situations where there isn't a huge number of
packages to upgrade, I find that aptitude does a great job:
  - interactive control over what is going to be done;
  - visualization of packages marked as auto-installed vs. those not
    marked as such (and you can flip this bit using m or M);
  - interactive, regexp-based search (with powerful features if you look
    up the syntax in the manual);
  - interactive package list limited by a user-defined filter (this is
    Limit Display in the Search menu);
  - interactive inspection of the (deps a package + other control
    fields) with Enter; of its reverse deps with the r key (and you can
    quicky recurse in order to find why you need to have this pkg
    installed);
  - works in a terminal;
  - etc.

There is the occasional crash, fortunately I've never seen one happen
while dpkg was installing, removing, etc., so the crashes I've seen were
all rather harmless (restart aptitude and proceed again). The worst I
had was on sid during the time_t transition: at some point, aptitude
couldn't start without crashing; however, after upgrading a few packages
with 'apt', it all went back into order. :-)

Regards

-- 
Florent

Reply via email to