please consider using "apt list --upgradeable" to updates_available
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::
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
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 1+0~20210301. 25+debian10~ 1.gbp2578a0] (1.1.1d-0+deb10u5 Debian- Security: 10/stable [amd64]) 1+0~20210301. 25+debian10~ 1.gbp2578a0] (1.1.1d-0+deb10u5 Debian- Security: 10/stable [amd64]) Security: 10/stable [amd64]) Security: 10/stable [amd64])
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-
Inst openssl [1.1.1j-
Conf libssl1.1 (1.1.1d-0+deb10u5 Debian-
Conf openssl (1.1.1d-0+deb10u5 Debian-