Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In the GUI tool you can get a list packages with security updates. Can this be done on the command line in Debian or Ubuntu?

Normally I might use "apt-get upgrade" which would show me what is being upgraded, but I would like to know which ones are security updates.

share|improve this question

4 Answers 4

up vote 2 down vote accepted

Use the unattended-upgrade application.

sudo unattended-upgrade

This lets you install only security updates automatically, but you can call it manually if needed.

share|improve this answer
I like this answer as you've actually thought about what I might be trying to do and unattended-upgrade is something I've installed today to try out. –  StephenPaulger Sep 5 '12 at 20:38
apt-get upgrade -s | grep -i security

... is what the Nagios check-apt plugin uses to count pending security updates which is similar to what you're looking for.

share|improve this answer
But it cannot find bash security update for shellshock? –  linjunhalida Sep 28 '14 at 2:18
This gives false positives on packages with "security" in the name, such as "xml-security-c-utils", "debian-security-support", "modsecurity-crs", "node-security", etc. –  Shnatsel Dec 16 '14 at 18:55

On ubuntu you should be able to use apt-check, it's the one that populates your motd with the number of security updates available.

share|improve this answer
I can't see that on debian or ubuntu. –  StephenPaulger Oct 22 '12 at 15:33
apt-check is in /usr/lib/update-notifier/. Try /usr/lib/update-notifier/apt-check --human-readable for a straightforward message. –  u2702 Oct 18 '14 at 1:30

You can get a list with this command:

sudo unattended-upgrade --dry-run -d 2>&1 > /dev/null | grep 'Checking' | awk '{ print $2 }'
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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