Wish: apt shouldn't show kept-back packages within the list of upgradable

Bug #1641303 reported by Oleksandr Pikozh
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Should apt consider kept-back packages as upgradable? Current state is:
1. Within 'apt dist-upgrade' it doesn't.
2. Within 'apt list --upgradable' and 'apt update' it does.

For example:

$ sudo apt update
> [...]
> Fetched 94,5 kB in 1s (66,0 kB/s)
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> 1 package can be upgraded. Run 'apt list --upgradable' to see it.

$ apt list --upgradable
> Listing... Done
> nvidia-304/xenial-updates,xenial-security 304.132-0ubuntu0.16.04.2 amd64 [upgradable from: 304.131-0ubuntu3]
> N: There is 1 additional version. Please use the '-a' switch to see it

$ sudo apt dist-upgrade
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> Calculating upgrade... Done
> The following packages have been kept back:
> nvidia-304
> 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

1) $ lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04

2) $ apt-cache policy apt
apt:
  Installed: 1.2.12~ubuntu16.04.1
  Candidate: 1.2.12~ubuntu16.04.1
  Version table:
 *** 1.2.12~ubuntu16.04.1 500
        500 http://ua.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     1.2.10ubuntu1 500
        500 http://ua.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

3) I expected output of 'apt update' and 'apt list --upgradable' to be consistent with output of 'apt dist-upgrade': i.e. if the former say there're upgradable packages, the latter should upgrade them.

4) 'apt update' and 'apt list --upgradable' consider kept-back packages as upgradable; luckily, 'apt dist-upgrade' doesn't.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: apt 1.2.12~ubuntu16.04.1
ProcVersionSignature: Ubuntu 4.4.0-47.68-generic 4.4.24
Uname: Linux 4.4.0-47-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: KDE
Date: Sat Nov 12 12:38:20 2016
InstallationDate: Installed on 2015-11-10 (367 days ago)
InstallationMedia: Kubuntu 16.04 LTS "Xenial Xerus" - Alpha amd64 (20151110)
SourcePackage: apt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Oleksandr Pikozh (o-pikozh) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

I get you what you say. But there is a distinction between (manually) upgradeable packages and packages that will be upgraded (automatically).

 I'm not going to decide whether the status is Opinion, Won't Fix, or Triaged, as I'm not entirely sure what we really want to do.

Revision history for this message
Oleksandr Pikozh (o-pikozh) wrote :

IMHO:

'apt list' should have at least 2 keys:
 - 'apt list --upgradable' to show packages that will be upgraded;
 - 'apt list --kept-back' to show packages on hold (= 'apt-mark showhold');
 - 'apt list --upgradable --kept-back' to show both (i.e. union).

And 'apt update' should report only '--upgradable' packages (not '--upgradable' + '--kept-back').

Revision history for this message
Oleksandr Pikozh (o-pikozh) wrote :

Note (tiny mistake in previous comment):
- - 'apt list --kept-back' to show packages on hold (= 'apt-mark showhold');
+ - 'apt list --kept-back' to show packages on hold that can be manually upgraded (⊆ 'apt-mark showhold');

(The fact that the package is on hold, per se doesn't necessary mean that it's manually upgradable. Sometimes the newest version of packages is providently put on hold. This 'apt list --kept-back' ⊆ 'apt-mark showhold', not necessarily 'apt list --kept-back' = 'apt-mark showhold'.)

Revision history for this message
Oleksandr Pikozh (o-pikozh) wrote :

Note (tiny mistake in previous comment):
- - 'apt list --kept-back' to show packages on hold (= 'apt-mark showhold');
+ - 'apt list --kept-back' to show packages on hold that can be manually upgraded (⊆ 'apt-mark showhold');

(The fact that the package is on hold, per se doesn't necessary mean that it's manually upgradable. Sometimes the newest version of packages is providently put on hold. Thus 'apt list --kept-back' ⊆ 'apt-mark showhold', not necessarily 'apt list --kept-back' = 'apt-mark showhold'.)

Revision history for this message
Oleksandr Pikozh (o-pikozh) wrote :

Sorry, it should be 'Thus' (a.k.a 'Therefore') instead of 'This' in the last sentence.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu):
status: New → Confirmed
Revision history for this message
ALinuxUser (buntulongername-new) wrote :

I too would welcome an option whereby apt-get update would wholly ignore 'held' - i.e., held back - packages.

Revision history for this message
Julian Andres Klode (juliank) wrote :

There's some misconception here; held back is a package-level flag.

ALinuxUser: Just use pinning instead of holds to achieve that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.