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

Bug#993287: "apt-get install" doesn't preserve autoinstall status of upgraded packages



On Mon, Aug 30, 2021 at 11:27:47AM +0300, Esa Peuha wrote:
> what has happened until recently. However, since apt 2.3.3 foo will be
> marked as manually installed, which seems to be an unintended change.

What makes you believe apt before 2.3.3 behaved differently?


I tried with 2.3.2 and 1.3 (= the first release with CMake buildsystem)
and both exhibit the behaviour you describe as an unintended change…
(attached is a testcase akin to what Julian described were in both
blocks the second apt-mark showmanual call fails as foo is now manual)

I did not implement this behaviour and it is always a bit surprising,
but I assume the idea was that if you cared enough about a package to
explicitly request it to be installed/upgraded you would be unhappy
if apt would later on decide that it can be autoremoved.

A case can also be made for that it is strange if an upgrade or not is
performed should have an effect on keeping auto or not. Imagine a user
who reads about 'foo' wants to use it and installs it only to find out
that it was already installed as a dependency of some other thing. If
that user had a fully upgraded system 'foo' would now be marked manual,
but if they had not, 'foo' would now potentially still be auto in your
scheme… that could be very surprising.


Best regards

David Kalnischkies
#!/bin/sh
set -e

TESTDIR="$(readlink -f "$(dirname "$0")")"
. "$TESTDIR/framework"
setupenvironment
configarchitecture 'amd64'

buildsimplenativepackage 'foo' 'all' '2' 'unstable'

setupaptarchive

insertinstalledpackage 'foo' 'all' '1'

msgmsg 'foo is upgraded from 1 to 2'
testsuccess aptmark auto foo
testempty aptmark showmanual foo
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  foo
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Inst foo [1] (2 unstable [all])
Conf foo (2 unstable [all])' apt install foo -s
testsuccess apt install foo
testempty aptmark showmanual foo

msgmsg 'foo is unchanged'
testsuccess aptmark auto foo
testempty aptmark showmanual foo
testsuccessequal 'Reading package lists...
Building dependency tree...
Reading state information...
foo is already the newest version (2).
foo set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' apt install foo -s
testsuccess apt install foo
testempty aptmark showmanual foo

Attachment: signature.asc
Description: PGP signature


Reply to: