I know there is lots of information on this around, but I still find it confusing. Please help me with this quick one liner.
What do I need to write and where to make this a permanent feature of my system?
This is the command:
sudo apt update &&\
sudo apt upgrade -y &&\
sudo flatpak update &&\
conda upgrade --all -yMaybe call it with sudo updateall
Slight digression: I asked a question about upgrade appimage and snap a while ago. There exists appimagehub but it pooly supported at the current time and snap by design updates without user involvement and there is no way to change this I believe. The others here can be manually updated.
23 Answers
In your .bashrc using vim ~/.bashrc add:
makealias() { echo "alias $1"="'${@:2}'" >> ~/.bashrc; }Next time you want to add a bash alias just type in the terminal:
makealias name commandexample: makealias brc vim ~/.bashrc
EDIT
This method does works with sudo, &&, || and other operators like ; if you enclose them in single quotes when making the alias.
Example: makealias updateall sudo apt-get update '&&' sudo apt-get upgrade
Do yourself a favor and use ; instead of &&, that is good practice.
Create a file updateall, put it on your path /usr/local/bin and make it executable.
You can format the file like this:
#!/bin/sh
sudo apt-get update
sudo apt-get upgrade -y
sudo flatpak upgrade
conda upgrade --all -yThen just run the script as updateall (without sudo)
To make it available to all users who have sudo privileges(needed for the commands)
sudo nano /etc/bash.bashrc
To make it available for your user only sudo nano /home/yourusername/.bashrc
Go to the bottom of the file and add your aliases like so, I included the commented out (#)ALIAS LIST title
#ALIAS LIST
alias updateall='apt update && sudo apt upgrade -y && sudo flatpak upgrade && conda upgrade --all -y'
alias sudo='sudo 'Save the file, then run exec bash from the terminal.
The first alias is your command, the second alias allows you to use sudo with aliases.