Update Arch shortcut

A simple script to update Archlabs:

#!/bin/bash
if [[ $UID == 0 ]]; then
	echo "Please run this script WITHOUT sudo:"
	echo "$0 $*"
	exit 1
fi

echo ===========
echo Aggiornamenti
echo ===========
sudo pacman -Syu
sleep 3

Make it executable and put it in shortcuts (in my case Control u :Exec lxterminal -e ~/script/update.sh in ~/.fluxbox/keys). Greetings

1 Like

Nice tip @cosmico

1 Like

Is there a reason you’re calling sudo twice for this command?

2 Likes

Personally I just use an alias:

alias u='sudo pacman -Syu'
2 Likes

Guess that it s a typo of some sort @PackRat

2 Likes

… it’s a typo (even if the script works the same)… :sweat_smile:

2 Likes

alias xu=‘yay’ # update standard pkgs and AUR pkgs (yay)
alias xi=‘yay -S’ # install a program.( xi conky)

If you type xu conky it will also search for all versions of conky.
With yay you don’t need to use -Syu to update the system just yay is enough.

2 Likes