please consider using "apt list --upgradeable" to updates_available

Bug #1837818 reported by Mike Miller
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
byobu
New
Undecided
Unassigned

Bug Description

Please consider updating the 'updates_available' caching function to use "apt list --upgradeable" as a slightly faster way to get the number of updates on Debian and Ubuntu and derivatives. This is available on any system with apt version 1.1 or newer, which includes Ubuntu 16.04 and Debian 9 and later.

On my system, "apt list --upgradeable" is faster than "apt-get -s upgrade", so it would be nice if this is added as a preferred alternative on systems where it's available.

Example:

    $ time apt-get -s -o Debug::NoLocking=true upgrade | grep -c ^Inst

    real 0m4.456s
    user 0m3.236s
    sys 0m0.083s

    $ time apt list --upgradeable 2>/dev/null | tail -n +2 | wc -l

    real 0m1.961s
    user 0m1.589s
    sys 0m0.062s

Revision history for this message
Link Porterfield (artgravity) wrote :

This method has an added benefit of not incorrectly interpreting possible downgrades as available updates.

I use PHP-FPM from the deb.sury.org repo which has newer libssl1.1 & openssl packages than those found in Debian base repositories. The apt-get method is registering Debian-Security repo downgrades for those packages as upgrades since the evaluate command greps for the "Inst" string.

While my systems actually have no upgrades available, byobu is reporting 2.

Compare:

$ apt list --upgradable
Listing... Done

$ apt-get -s -o Debug::NoLocking=true upgrade
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be DOWNGRADED:
  libssl1.1 openssl
0 upgraded, 0 newly installed, 2 downgraded, 0 to remove and 0 not upgraded.
Inst libssl1.1 [1.1.1j-1+0~20210301.25+debian10~1.gbp2578a0] (1.1.1d-0+deb10u5 Debian-Security:10/stable [amd64])
Inst openssl [1.1.1j-1+0~20210301.25+debian10~1.gbp2578a0] (1.1.1d-0+deb10u5 Debian-Security:10/stable [amd64])
Conf libssl1.1 (1.1.1d-0+deb10u5 Debian-Security:10/stable [amd64])
Conf openssl (1.1.1d-0+deb10u5 Debian-Security:10/stable [amd64])

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.