Ubuntu – How to use apt-get to only install critical security updates on ubuntu

aptUbuntu

How do you use apt-get to only install critical security updates on ubuntu?

We'd like to only upgrade packages that need to be upgraded for security reasons, without upgrading all other packages.

Best Answer

I read the apt-get man page carefully when I got tired of manually editing the sources.list every time I wanted to only apply security updates (that means the second time).

Figured this solution out:

sudo cp /etc/apt/sources.list /etc/apt/security.sources.list

Edit the latter to contain only security repositories, then:

sudo apt-get upgrade -o Dir::Etc::SourceList=/etc/apt/security.sources.list

Tadaaaa... Scriptable stuff.