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

Bug#1008709: marked as done (python3-apt: Overriding Package candidate is ignored)



Your message dated Thu, 31 Mar 2022 08:14:25 +0200
with message-id <20220331080300.GA806020@debian.org>
and subject line Re: Bug#1008709: python3-apt: Overriding Package candidate is ignored
has caused the Debian Bug report #1008709,
regarding python3-apt: Overriding Package candidate is ignored
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1008709: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008709
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
On Wed, Mar 30, 2022 at 06:37:45PM -0400, Matt Culler wrote:
> 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.

I don't see a problem here. You selected a version of curl for
installing that probably requires a newer libcurl, but which was
not the candidate and hence the curl upgrade was held back during
the mark_install() call.

To see whether the candidate was applied correctly, you'd have to
check the output of

c._depcache.get_candidate_ver(pkg._pkg)

and I'm sure it would show the correct thing.

There's no clean way to make it do what you want here, that's just
not a thing.

And the usual advice:

- To install/remove multiple packages do

  1. mark all packages for install with  auto_inst set to False
     (and auto_fix=False for apt.*); same for removals
  2. repeat the same loop but with auto_inst=True
  3. Run an apt_pkg.ProblemResolver() if anything is broken

- Use apt_pkg, not apt. The simplistic interface of the apt package
  is inappropriate for basically anything and leads to wrong and
  most often terribly slow code.


-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en

--- End Message ---

Reply to: