Bug#1008709: python3-apt: Overriding Package candidate is ignored
Package: python3-apt
Version: 2.2.1
Severity: normal
X-Debbugs-Cc: mculler@tetracore.com
Dear Maintainer,
If I apt remove curl, then run the following code:
>>> import apt
>>> c = apt.Cache()
>>> pkg = c['curl']
>>> pkg.mark_install()
>>> c.commit()
Selecting previously unselected package curl.
(Reading database ... 201874 files and directories currently installed.)
Preparing to unpack .../curl_7.74.0-1.3+deb11u1_amd64.deb ...
Unpacking curl (7.74.0-1.3+deb11u1) ...
Setting up curl (7.74.0-1.3+deb11u1) ...
Processing triggers for man-db (2.9.4-2) ...
True
Curl will be installed. But then, if I want to install the version from
bullseye-backports:
>>> import apt
>>> c = apt.Cache()
>>> pkg = c['curl']
>>> print(pkg.versions)
[curl=7.82.0-2~bpo11+1, curl=7.74.0-1.3+deb11u1]
>>> pkg.candidate = pkg.versions[0]
>>> pkg.mark_install()
>>> c.commit()
True
The above code does nothing. However, doing the same thing on a stretch
machine I have access to works, though I used the "whois" package rather
than "curl" because it has a version on stretch-backports.
Thanks,
Matt
-- System Information:
Debian Release: 11.3
APT prefers stable-security
APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 5.10.0-13-amd64 (SMP w/8 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages python3-apt depends on:
ii distro-info-data 0.51+deb11u1
ii libapt-pkg6.0 2.2.4
ii libc6 2.31-13+deb11u3
ii libgcc-s1 10.2.1-6
ii libstdc++6 10.2.1-6
ii python-apt-common 2.2.1
ii python3 3.9.2-3
Versions of packages python3-apt recommends:
ii iso-codes 4.6.0-1
ii lsb-release 11.1.0
Versions of packages python3-apt suggests:
ii apt 2.2.4
pn python-apt-doc <none>
pn python3-apt-dbg <none>
-- no debconf information
Reply to: