Updating Ubuntu has never been easier - thanks to us!
We have the optimal solution to install any available update with just one click!
If you like this or any other article, we would appreciate a like and a comment. ❤️
Don't you believe us? Then let yourself be carried away into the world of Ubuntu update codes!
Schaechner / Ubuntu-Update-Script
a simple, quick-to-install update script for its own servers running Ubuntu.
Update-Skript
a simple, quick-to-install update script for its own servers running Ubuntu.
Install dependencies
sudo apt install figlet toilet
Run
sh update.sh
A simple update in Linux always consists of several parts. So we thought it wouldn't make more sense if we just code something so that we only have to enter one line of code, but all updates are executed.
Said and done.
sudo echo "
echo -n UPDATE: && sleep 3 && sudo apt update -y && sudo apt-get update -y &&
echo -n UPGRADE: && sleep 3 && sudo apt upgrade -y && sudo apt-get upgrade -y &&
echo -n FULL-UPGRADE: && sleep 3 && sudo apt full-upgrade -y && sudo apt-get full-upgrade -y &&
echo ---- &&
echo -n Your system has been updated, echo "$USER" &&
sleep 1 &&
figlet You are up to date, &&
toilet "$USER" &&
sleep 5 &&
clear
Now all updates are done at once - even with a personalized message at the end. But to get this personalized message, we need figlet
and toilet
. We'll install that with sudo apt install figlet toilet
.
The code in general is a shell script.
Let's break down the code step by step:
sudo echo"
This line is using sudo to elevate privileges and execute the echo command. However, the use of sudo with echo won't have any impact on the output. It essentially outputs an empty line with a newline character.
echo -n UPDATE: && sleep 3 && sudo apt update -y && sudo apt-get update -y &&
This line outputs the text "UPDATE:" without a newline (-n flag), then it waits for 3 seconds using sleep
, followed by running the system package update commands. Both sudo apt update -y
and sudo apt-get update -y
are used to update package information from the repositories.
echo -n UPGRADE: && sleep 3 && sudo apt upgrade -y && sudo apt-get upgrade -y &&
Similar to the previous line, this line outputs "UPGRADE:" without a newline, waits for 3 seconds, and then proceeds to perform system package upgrades using sudo apt upgrade -y
and sudo apt-get upgrade -y
.
echo -n FULL-UPGRADE: && sleep 3 && sudo apt full-upgrade -y && sudo apt-get full-upgrade -y &&
This line is again similar to the previous lines, but it's executing a full system upgrade using sudo apt full-upgrade -y
and sudo apt-get full-upgrade -y
.
echo ---- &&
This line prints a line of dashes to serve as a separator between the update/upgrade information and the following message.
echo -n Your system has been updated, echo "$USER" &&
This line attempts to print the message "Your system has been updated" without a newline. The subsequent echo "$USER"
should be a separate command to correctly print the username of the currently logged-in user.
sleep 1 &&
This line introduces a 1-second delay using sleep
.
figlet You are up to date, &&
This line uses the figlet
command to create an ASCII art text that says "You are up to date". The output will be stylized text.
toilet "$USER" &&
This line uses the toilet command to create another ASCII art text, this time displaying the username of the currently logged-in user.
sleep 5 &&
Another delay of 5 seconds is introduced using sleep.
clear
This command clears the terminal screen.
Thank you for reading this far. Do you have any questions, suggestions or requests? Feel free to write it in the comments!
Top comments (0)