Skip to content

Instantly share code, notes, and snippets.

@pmkay
Last active July 14, 2019 01:16
Show Gist options
  • Save pmkay/ca353df0b3254f7f2e337f035fe0457a to your computer and use it in GitHub Desktop.
Save pmkay/ca353df0b3254f7f2e337f035fe0457a to your computer and use it in GitHub Desktop.
Update Security Patches only for Ubuntu

List Security Updates

To display security updates only , sudo unattended-upgrade --dry-run -d

Or

apt-get -s dist-upgrade| grep "^Inst" | grep -i security

apt-get -s dist-upgrade | grep "^Inst"

Finally, to install security updates only, run

apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install

Manually Install Security Updates To manually configure a system for security updates,

First, install unattended-upgrade package

apt-install unattended-upgrades

For Dry Run `sudo unattended-upgrade -d -v

### List Security Updates
To display security updates only ,
`sudo unattended-upgrade --dry-run -d`
**Or**
`apt-get -s dist-upgrade| grep "^Inst" | grep -i security`
`apt-get -s dist-upgrade | grep "^Inst"`
Finally, to install security updates only, run
`apt-get -s dist-upgrade | grep "^Inst" | grep -i securi | awk -F " " {'print $2'} | xargs apt-get install`
Manually Install Security Updates
To manually configure a system for security updates,
First, install unattended-upgrade package
`apt-install unattended-upgrades`
For Dry Run
`sudo unattended-upgrade -d -v`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment