Updating and Upgrading a Debian base Linux OS,s
Aliases for updating, upgrading and cleaning with “update“
Thank you for reading this post, don't forget to subscribe!
To add aliases for updating, upgrading and cleaning up a Debian-based Linux system within the .bashrc
file, you can follow these steps:
- Open a terminal and switch to your user account by running the command
su - yourusername
. - Open the
.bashrc
file in your preferred text editor. For example, to open the file using the Nano editor, run the commandnano ~/.bashrc
. - Add the following lines to the end of the
.bashrc
file:
# Alias for updating and upgrading the system
alias update='sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y'
- Save the changes and exit the editor by pressing
Ctrl+X
, thenY
, thenEnter
. - Reload the
.bashrc
file to apply the changes by running the commandsource ~/.bashrc
.
Now, whenever you want to update, upgrade and clean up your Debian-based Linux system, you can simply run the update
alias in the terminal. This will automatically run the necessary apt
commands to update, upgrade and clean up the system.
$ update
Will update, upgrade and clean your system. It will require and ask for sudo password. You will get a Ok in your screen if all goes well.
0 - 0