[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Return a Debian system to a pristine state



On 2020-06-05 at 11:38, Victor Sudakov wrote:

> John Hasler wrote:
> 
>> David Wright writes:
>> 
>>> That begs the question of what pristine means, because it has
>>> never been defined even by the OP.
>> 
>> I thought that we had learned that what he really wanted was to be
>> able to identify packages that have not been used recently and
>> remove them.
> 
> What I originally wanted was based on the false assumption that
> there are "system packages" and "user packages" in Debian, which
> turned out not to be the case.
> 
> The assumption was also formed partly after the FreeBSD experience,
> and partly under the impression of Pamac, Mint Software Manager, App
> Store, Google Play and other "software centers" which offer
> productivity software install/uninstall in convenient form.
> 
> The ability to identify packages that have not been used recently
> and remove them, would be useful too.

Defining "used" in terms which an algorithm could detect would be
difficult here (Windows tries, or used to, but in my experience almost
always gets it wrong), but you might find some benefit from deborphan,
in the package of the same name. It basically reports the names of
installed packages which are not depended on by anything else.

On its face this wouldn't be useful, since nearly everything you've
explicitly installed will usually qualify; what makes it useful is that
it can (and, by default, does) limit its search to only specific
sections of the Debian package archive, such as libs, oldlibs, and so
forth.

Since 'apt-get autoremove' already detects and removes packages which
were installed only as dependencies and aren't depended on anymore, this
is useful only for packages which got explicitly installed once upon a
time and may have been forgotten about. I don't see such very often
anymore, but when I first installed deborphan and tried it out, I found
a surprising number of them.

Nowadays, my regular upgrade-against-testing routine - carried out at
least weekly, if not daily - consists of the following (with adjustments
to account for undesired installations, removals, bugs as reported by
apt-listbugs, et cetera):

$ apt-get update
$ apt-get dist-upgrade
$ apt-get autoremove
$ apt-get remove $(deborphan)

And if the deborphan step finds anything, I go back to the autoremove
step, and repeat until neither of them has found anything.

When I first started with deborphan, it took me somewhere between three
and six repetitions of that pair of commands before I got to that point.
Now, I can't even remember the last time deborphan found anything,
because the system is already clean in this regard - but I still keep it
up, just to make sure that doesn't change.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: