0

To check pending updates with:

apt-get upgrade

...takes quite a while.

Is there a faster way to only show pending updates (assuming you have already updated the source list before with apt-get update)

  • AFAIK , searching for a fast mirror and then looking after apt-get upgrade would help you. – rɑːdʒɑ Dec 27 '15 at 6:56
  • 1
    Give it the --dry-run option? – Mark Plotnick Dec 27 '15 at 16:12
  • Are you looking for aptdaemon? – Gilles Dec 27 '15 at 17:31
  • No, i look for a way to check in milliseconds if there are pending upgrades – rubo77 Dec 27 '15 at 22:23
1

You can install cron-apt which periodically automates the process to upgrade the Debian system:

apt-get install cron-apt 

By default it updates the source list and automatically downloads all new packages. Downloading is not needed in this case, so you disable the download part by removing the download commands:

rm /etc/cron-apt/action.d/3-download

(In case later you need it: the configuration files are in /usr/share/doc/cron-apt/examples/)

This assures that you package list is up-to-date enough. Now you can get the number of packages that would be upgraded with

LANG=C apt-get upgrade -s |grep -P '^\d+ upgraded'|cut -d" " -f1

Or alternative you can install apt-show-versions to use this instead to show the number of packets that have updates:

apt-show-versions -b -u|wc -l
0

Easiest is with apt-show-versions -u. Shows only installed packages with available updates with current and available version. Use -b to show only the package name (suitable for feeding to apt-get install).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.