Combining sudo apt update+upgrade

Posted on: 14 Dec 2023

I am not a frequent Ubuntu user, but I use it enough to find it frustrating to repeatedly type sudo apt update, enter my password, and then type sudo apt upgrade. I thought I was the only one who felt this way, but it turns out many others share this annoyance, and there is a simple solution to address it.

We can create an alias for a set of commands in the .bashrc file, and the computer will remember it.

How I created nimupdate

This is the alias we will use:

# Custom alias for updating system
nimupdate() {
    echo "Starting system update..."
    sudo apt update && sudo apt upgrade -y
    echo "System update completed."
}

Next, add this to the .bashrc file.

Follow these steps: