Control: retitle -1 apt upgrade <pkg>: it removes packages when it
shouldn't.

The case you mentioned is a tricky one, yes: *apt upgrade foo+ bar-* (I
really don't know how apt handles it internally but having this option is
very useful. Of course, I wouldn't remove it).

I think it makes a lot of sense for "apt upgrade" to allow packages as
arguments. There should be a possibility to upgrade only a set of packages
and it comes in handy in some situations (i.e.: t64 upgrade). "apt upgrade"
also doesn't mark upgraded packages as manually installed (as expected).
But "apt install" does mark them as manually installed (as expected too).

Therefore, I see 2 options here:

a) Change apt documentation to include the current behaviour. But if so, it
should *NOT* remove any packages.
b) Remove the possibility to specify packages to upgrade as arguments
(which I don't really recommend for the reasons stated above).

Anyway, I think some clarification is needed from the developers to shed
some light on this.

Regards

On Tue, Mar 12, 2024 at 3:12 AM Wesley Schwengle <wes...@schwengle.net>
wrote:

> On Mon, Mar 11, 2024 at 11:32:24PM +0100, Miguel Angel Rojas wrote:
> > > I see. It looks like `apt upgrade <package>' behaves as `apt install
> > > <package>'. Which (to me) is unexpected behaviour, as the man page is
> > quite
> > >clear on its behaviour (man 8 apt-get):
> >
> > Well, clearly it shouldn’t. To begin with, “apt install” should mark a
> > package as manual installed while “apt upgrade” shouldn’t (my
> assumption).
> > And you’re right that “apt install” can remove a package if needed to
> > satisfy dependencies.
> >
> > On top of that, documentation clearly states that “apt upgrade” should
> not
> > remove any package, but it does when you specify an individual package to
> > upgrade.
> >
> > If this is not the expected behavior, maybe this is a bug (unless I am
> > missing something here).
>
> I do not know what the bug here is, it could be one of these options:
>
> 1) apt-get/apt upgrade accepts packages to upgrade where the docs state it
>    doesn't. The behaviour needs to change to not accept packages.
>
> 2) apt-get/apt upgrade accepts packages and removes packages to satisfy
> deps
>    where the docs state it doesn't. The behaviour need to change to not
> remove
>    any packages. There is a small edge case where you can say: `apt
> upgrade foo
>    bar-'. Technically, it shouldn't remove packages, yet you want and
> instruct
>    it to remove bar.
>
> FWIW, aptitude does not remove packages where you call `aptitude
> safe-upgrade
> foo'. It does remove packages when you call `aptitude full-upgrade foo'. It
> also removes bar when you run `aptitude safe-upgrade foo bar-'.
>
> I'll leave this for the maintainers to answer.
>
> Cheers,
> Wesley
>
>

Reply via email to