Skip to content

Instantly share code, notes, and snippets.

@colby
Created April 28, 2016 19:17
Show Gist options
  • Save colby/5f980d3ba3977203391dedb444d0f444 to your computer and use it in GitHub Desktop.
Save colby/5f980d3ba3977203391dedb444d0f444 to your computer and use it in GitHub Desktop.
A package upgrade checking script.
#!/bin/bash
file=/tmp/packages
/usr/lib/update-notifier/apt-check --human-readable
[ -f /var/run/reboot-required ] && echo -e "\nA reboot is required!"
apt list --upgradable > $file 2>/dev/null
echo -e "\nNormal package updates:"
pr -T -c3 -a <(grep 'update' $file | cut -d/ -f1)
echo -e "\nSecurity package updates:"
pr -T -c3 -a <(grep 'security' $file | cut -d/ -f1)
@colby
Copy link
Author

colby commented Apr 28, 2016

$ ./utility/scripts/apt/package_check.sh
250 packages can be updated.
147 updates are security updates.

A reboot is required!

Normal package updates:
accountsservice         apport                  apt
apt-transport-https     apt-utils               augeas-lenses
base-files              bash                    bash-completion
bind9-host              binutils                bsdutils
byobu                   ca-certificates         cloud-guest-utils
cloud-init              coreutils               cpio
curl                    dbus                    dh-python
dkms                    dnsutils                dpkg
...


Security package updates:
apt                     apt-transport-https     apt-utils
bash                    bind9-host              ca-certificates
cloud-init              cpio                    curl
dbus                    dkms                    dnsutils
dpkg                    dpkg-dev                file
fuse                    gnupg                   gpgv

@parhamr
Copy link

parhamr commented Apr 28, 2016

👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment