Arch Linux update script
12 07 2012A script to automate the process of updating Arch Linux, removing orphane packages, cleaning pacman caches, locales and manpages.
The script needs installed and configured yaourt, localepurge and sudo to run.
What it does is:
- Shows you the latest 3 Arch Linux news titles. You should check them for "manual intervention required"-notices.
- Performs a full system update
- Searches for orphaned packages and removes them
- Cleans pacmans package caches
- Invokes localepurge to delete unnneeded locales and man pages
Here is a screenshot of the script in action:
And here is the code, or download it here.
#!/bin/bash
# Adams arch_update.sh v1.0
# I'm GPLv3 of course
echo Latest Archlinux news:
curl --silent "https://www.archlinux.org/feeds/news/" | \
tr -d '\n\r' | \
sed 's/<\/item>/<\/item>\n/g' | \
sed -r 's/.*<title>(.*)<\/title>.*tag:www\.archlinux.org,([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]).*/\2 \1/' | \
head -3
echo
echo Press enter for update
read
echo
yaourt -Syua
echo removing orphans:
yaourt -Qdtq >/tmp/tokillpackages
yaourt -Rsn `paste /tmp/tokillpackages`
echo cleaning pacman caches
yes | LC_ALL=C yaourt -Scc
echo cleaning up some locales
sudo localepurge
Kategorien : Linux
Trackbacks : Keine Trackbacks»