Quantcast
Channel: [In]effective Theory
Viewing all articles
Browse latest Browse all 53

Uninstalling X11 on OpenBSD

$
0
0

X11 is distributed on OpenBSD as an optional part of the core system, rather than as its own set of packages; therefore, there is no pkg_delete available to automate uninstallation. Fortunately, the standard installation procedure is simple enough to be easily automated. Installation (or upgrade) consists of unpacking the new set of tarballs directly onto the filesystem. Thus, for uninstallation, we simply obtain a list of installed files and remove them.

First, you should make sure there are no packages dependent on X11 installed. Re-download whatever versions of the X11-related packages you have installed. For OpenBSD 5.0, this is:

wget http://ftp.openbsd.org/pub/OpenBSD/5.0/amd64/xbase50.tgz
wget http://ftp.openbsd.org/pub/OpenBSD/5.0/amd64/xetc50.tgz
wget http://ftp.openbsd.org/pub/OpenBSD/5.0/amd64/xfont50.tgz
wget http://ftp.openbsd.org/pub/OpenBSD/5.0/amd64/xshare50.tgz
wget http://ftp.openbsd.org/pub/OpenBSD/5.0/amd64/xserv50.tgz

Now generate a list of all files in those tarballs:

for f in *.tgz; do tar tzf $f; done | sed "s/^.//" | uniq > l

Do not recursively delete everything in this list - the output of tar tf includes all superdirectories, so doing so would wipe most of your installation.

At this point, the tarballs are no longer needed, so delete them.

Now we select all files and delete them:

for f in `cat l`; do if [ -f $f ]; then echo $f; fi; done | xargs rm

And now for directories (again, do not use rm -r):

for f in `cat l`; do if [ -d $f ]; then echo $f; fi; done | xargs rmdir

X11 will leave a few autogenerated files in predictable locations, namely /usr/local/lib/X11, /usr/X11R6, and /etc/X11. You can locate any others with locate X11.

(Note that under ordinary circumstances, there is no reason to uninstall X11 - this should only be useful in the rare case that saving those 200 MB of disk space really matters.)


Viewing all articles
Browse latest Browse all 53

Trending Articles