Keeping Arch Clean

March 24, 2010 at 3:18 pm (arch, bash, commands, terminal, tips)

So I’ve been digging around on the Arch forums and came across a little script to run. It will show you what you’ve installed explicitly to help keep your system clean and free from miscellaneous packages. Simply save the following script to a blank text document (no file extension needed):

#!/bin/bash
pacman -Qei | awk '/^Name/ { name=$3 } /^Groups/ { if ( $3 != "base" && $3 != "base-devel" ) { print name } }' > exp_pkglist

Then simply run the file with this command:
$ bash FILE_NAME_HERE.

It will export all your explicitly installed packages (excluding base and base-devel) to a text file which you can then go through and $ sudo pacman -Rs PACKAGE_NAME_HERE. That should help keep your system clean.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: