Skip to content

Instantly share code, notes, and snippets.

@andresvia
Created February 3, 2014 14:30
Show Gist options
  • Save andresvia/8784810 to your computer and use it in GitHub Desktop.
Save andresvia/8784810 to your computer and use it in GitHub Desktop.
My Arch Linux update routine
#!/bin/bash
COMMANDS_TEMP="$(mktemp)"
COMMANDS="$(mktemp)"
cat > "$COMMANDS_TEMP" << 'EOF'
df -h
links https://www.archlinux.org/news/
sudo pacman -Syu
pacman -Qi | egrep '^Name[[:space:]]*:|^Packager[[:space:]]*:[[:space:]]*Unknown Packager' | grep -B1 '^Packager' | grep '^Name' | cut -d':' -f2 | xargs pacman -Q
pacman -Qi | egrep '^Name[[:space:]]*:|^Packager[[:space:]]*:[[:space:]]*Unknown Packager' | grep -B1 '^Packager' | grep '^Name' | cut -d':' -f2 | while read LINE; do xterm -e links "https://aur.archlinux.org/packages/$LINE/"; done
sudo locale-gen
sudo mandb -q
sudo updatedb
sudo update-pciids
sudo update-desktop-database
sudo update-mime-database /usr/share/mime
sudo update-ca-certificates
sudo find / -iname '*.pacnew*' -o -iname '*.pacorig*' -o -iname '*.pacold*'
curl 'https://raw.github.com/oblique/create_ap/master/create_ap' > ~/create_ap.new
curl 'http://www.matijs.net/software/msgconv/msgconvert.pl' > ~/msgconvert.pl.new
diff ~/create_ap.new ~/create_ap
diff ~/msgconvert.pl.new ~/msgconvert.pl
pacman -Qi | awk 'BEGIN{X=0}{if($1 == "Optional" && $2 == "Deps")X=1 ; if($1 == "Required" && $2 == "By")X=0 ; if(X==1)print $0 ; }' | egrep -v 'Optional Deps : None|\\[installed\\]' | sed 's|^.\\{17\\}||' | sort -u
EOF
while read LINE
do
echo "read -p \"Enter para continuar con '$LINE': \" CONT"
echo "[ \"\$CONT\" != \"n\" ] && $LINE"
done < "$COMMANDS_TEMP" > "$COMMANDS"
. "$COMMANDS"
rm -f "$COMMANDS_TEMP" "$COMMANDS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment