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

Re: cleanly getting rid of manually installed transitional packages due to rename



On Wed 06 May 2020 at 12:31:35 (+0200), Vincent Lefevre wrote:
> On 2020-04-28 10:21:16 -0500, David Wright wrote:
> > On Sat 25 Apr 2020 at 21:41:09 (+0200), Vincent Lefevre wrote:
> > > I think that you are over-optimistic. Imagine the following case.
> > > The pdftk package has been manually installed in the past and is
> > > now a transitional package to pdftk-java (currently, this is like
> > > your example). But the system has some package that depends on
> > > pdftk-java. So, when you run
> > > 
> > >   apt-get -s purge pdftk
> > > 
> > > you won't have any message about pdftk-java.
> > 
> > Sure, that could happen, and the solution is pretty much the same as
> > getting too many packages: there's bound to be a dependent
> > relationship between pdftk and whatever the replacement is.
> > So in either eventuality, you would either have included that check
> > in your script, or would kick yourself that you hadn't.
> 
> Well, I think that the solution is not to get the information
> via "apt-get -s purge" but via "apt-cache depends".

Yes, if you're writing a script, which I wasn't. (I just wanted to
remove some redundant packages after the stretch→buster upgrade.)

> This would
> be the following zsh script:

[…]

> if [[ $# -ne 1 ]] then
>   echo "Usage: $0 <package>" >&2
>   exit 1
> fi

If I were running this regularly, I might loop over all the packages,
rather than have to pick and choose from some sort of list.

> Note: "apt-cache depends" is multiarch-aware, i.e. it will append
> the architecture when need be, which is a good thing here (and when
> doing things manually, e.g. by looking at the "dpkg -s" output, it
> can be easy to forget that).
> 
> > As I said, this has to be done so infrequently (in stable, at least),
> 
> I use unstable. I doubt that packages get renamed in stable
> (except between full upgrades, where the issue has already
> been solved with the oldlibs section).

I don't understand the relevance of oldlibs: only one of the packages
that I removed was in that section, imagemagick, which gets pulled in
under that name by inkscape as a Recommends.

There are odd lib… packages in oldlibs on my system, but I generally
let them sort themselves out. The only lib… I install manually is
libsox-fmt-mp3.

> > that I've never bothered to think about scripting it, which means
> > that interactively you just deal with any corner cases as they arise.
> 
> Yes, one can do that manually. But one important issue is that one may
> forget to do that and use "apt purge ..." directly without remembering
> that one also needs to mark the dependencies as manually installed
> (and the script does not solve this particular issue, since one may
> forget to run it, at least when one has taken the habit to use
> "apt purge ..." directly).

As you run unstable, then perhaps you use purge very differently,
and a lot more frequently. In the time I've been running buster,
I've removed two american dictionaries (which install during
installation) in favour of british ones, the wacom driver, and
one or two packages that I installed out of curiosity and then
purged again. That's apart from removing those connected with
this thread, the transitional dummies.

Cheers,
David.


Reply to: