

This will hang the script unless you provide input.Īlthough these prompts could be overridden with export DEBIAN_FRONTEND=noninteractive, responding to the prompts provides greater control. You may be prompted for input for things like GRUB updates, or which version of a file to keep. It is recommended that you run this script interactively instead of calling it with another script or process.

Output will be the normal output to std-out of running the apt-get update, upgrade, dist-upgrade, and autoremove commands.Ī video showing a sample run can be found at No option - Run all options (recommended) Set it so it is executable using the command: You must have sudo permissions to run this script. You could, however, scavenge some useful features like using getopts to accept command line arguments for your other scripts! Prerequisites If you maintain a large Ubuntu Server infrastructure, you likely have a patch management system, so this probably isn’t for you. If, like me, you maintain several Ubuntu Linux systems, and you find yourself typing sudo apt update & sudo apt upgrade -y & sudo apt full-upgrade -y, this script is for you! The goal of this project is to provide an easy to use, single command to automate the tasks routinely undertaken to update an Ubuntu system, and to provide the messages that require further action or inquiry at the end of the run.

This script puts clear banners at the beginning of each activity and parses output in an attempt to present items of interest like warnings or reboot messages at the end of the output. I made a script that did this, but thought it would also be fun to make it a bit more functional and make it available to everyone.Īlso, I noticed that when these commands are run together, the output can get quite lengthy, and there’s no clear separation between the parts running, so I’d have to scroll back up through the output to see whether there was any output requiring action. I maintain several individual Ubuntu 16.04 Long Term Support (LTS) Servers and found myself typing sudo apt update & sudo apt upgrade -y & sudo apt full-upgrade -y often. Similar results can be obtained by simply running sudo apt update & sudo apt upgrade -y & sudo apt full-upgrade -y & sudo apt autoremove -y so this is as much an exercise in simple bash scripting concepts as anything. This project is in GitHub and can be found here Set the file to executable then run it with sudo as outlined below to update your Ubuntu system. A bash script to update your Ubuntu system.
