This site is now 100% read-only, and retired.

What is the 'safest' way to Remove X11

Posted by muondude on Tue 20 Sep 2005 at 11:37

Tags: ,

I have a server that I recently upgraded from Woody to Sarge. I'm trying to clean it up and remove all unnecessary software and packages. I don't use the X-window system (X11) anymore and want to remove all components. I'm concerned that I might break something and don't want to hose the server.

I started using aptitude and looked at uninstalling:

x-window-system-core
xfree86-common
xserver-common
xserver-xfree86 

This seemed like it would leave a lot of broken packages, so I didn't do it and thought I should ask for advice. I tried some googling for a meta-package with no luck.

I access this server either from the console (no X-windows) or via SSH, so I don't need nor want X and just want it all gone.

TIA
-- Sam

 

 


Re: What is the 'safest' way to Remove X11
Posted by Anonymous (195.225.xx.xx) on Tue 20 Sep 2005 at 12:59
deborphan can help you a bit

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by Anonymous (66.152.xx.xx) on Tue 20 Sep 2005 at 16:54

[ Parent ]

No need for deborphan
Posted by Demitsu (84.176.xx.xx) on Tue 20 Sep 2005 at 17:53
deborphan won't make the neccesary decisions for you.

Removing aforementioned packages seems to be the right way to go. You just need to make sure you do not need the packages which will break. Things like KDE/GNOME, xfig, fonts and stuff can be removed without ill effects, since they would be useless without X11 anyway.

Packages depending on xlibs may be a different matter, though: Some software (like gnuplot) have the nasty habit of uniting Commandline- and Graphical User Interface into a single binary. In that case, you will need to leave xlibs intact, as well as it's dependencies (recursively).

I must confess I'm pretty lazy, so aptitudes "Mark as automatically/manually installed" comes in handy, replicating deborphan's functionality. Pressing 'M' (capital) will mark the selected package as 'automatically installed'. Whenever aptitude doesn't detect any package depending on the selected package, it will be removed.

For that matter, aptitude automatically marks packages it has installed for dependencies' sake as 'automatically installed'. Only those packages initially deployed on your system by debian-installer are marked as 'manually installed'. After installation of a new Debian system, I usually skim through the package list and correct this by e.g. marking all libraries (regardless if installed or not) as 'manually installed'.

I hope this was clear enough to be understandable.

PS: Pressing 'b' in aptitude jumps to the next broken yackage.
PS2: I know there's a gnuplot-nox package for CLI-only gnuplot. Couldn't come up with a better example ;)

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by suspended user muondude (206.117.xx.xx) on Wed 21 Sep 2005 at 06:12
[ View Weblogs ]
Thanks for the good feedback.

I started going through the list of files and checked some for removal with aptitude (not in cmd-line but screen mode). And it has turned into a bit of a dependencies nightmare. For example, xlibs seems to affect many non-X11 related applications.

I started by tryting to make a list of all the proposed package upgrades and then looking at the impact of removal. It very quickly got out of control. For some of the packages there seems to be no problem, but others seem very confusing. For example it looked as if xlibs shouldn't be removed?

I'm open to other suggestions on how to systematize this. I thought about trying to remove the ones I was pretty sure were OK, one at a time from the command line and seeing if anything broke?

-- Sam

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by Steve (82.41.xx.xx) on Wed 21 Sep 2005 at 10:55
[ View Weblogs ]

Remove the higher level packages (eg. xterm, rxtrm, x-window-system) until you get errors - then stop to see what you need to keep.

You will almost certainly need to keep xlibs, and a few other graphical libraries because console applications use them - eg the ImageMagick command line tools.

You'll need xbase-clients installed if ever you want to do X11 forwarding via SSH.

Otherwise only you will know what you need. On my ssh-only server I see I have:

root@skx2:~# dpkg --list |grep 4.3.0.dfsg.1-1
ii  libdps1        4.3.0.dfsg.1-1 Display PostScript (DPS) client library
ii  libice6        4.3.0.dfsg.1-1 Inter-Client Exchange library
ii  libsm6         4.3.0.dfsg.1-1 X Window System Session Management library
ii  libx11-6       4.3.0.dfsg.1-1 X Window System protocol client library
ii  libxext6       4.3.0.dfsg.1-1 X Window System miscellaneous extension libr
ii  libxft1        4.3.0.dfsg.1-1 FreeType-based font drawing library for X (v
ii  libxi6         4.3.0.dfsg.1-1 X Window System Input extension library
ii  libxmu6        4.3.0.dfsg.1-1 X Window System miscellaneous utility librar
ii  libxmuu1       4.3.0.dfsg.1-1 lightweight X Window System miscellaneous ut
ii  libxp6         4.3.0.dfsg.1-1 X Window System printing extension library
ii  libxpm4        4.3.0.dfsg.1-1 X pixmap library
ii  libxrandr2     4.3.0.dfsg.1-1 X Window System Resize, Rotate and Reflectio
ii  libxt6         4.3.0.dfsg.1-1 X Toolkit Intrinsics
ii  libxtrap6      4.3.0.dfsg.1-1 X Window System protocol-trapping extension 
ii  libxtst6       4.3.0.dfsg.1-1 X Window System event recording and testing 
pi  xfree86-common 4.3.0.dfsg.1-1 X Window System (XFree86) infrastructure
ii  xlibs          4.3.0.dfsg.1-1 X Keyboard Extension (XKB) configuration dat
ii  xlibs-data     4.3.0.dfsg.1-1 X Window System client data

There are other graphical libraries installed such as libpng, libjpeg too.

I guess I'd question why you want to do this too - do you want to save disk space? Or just feel better knowing you don't have more software installed than you need?

Steve
--

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by suspended user muondude (130.221.xx.xx) on Thu 22 Sep 2005 at 00:07
[ View Weblogs ]
Steve:

Thanks for the feedback. I'll give it a try. Your suggestions are in line with where I wanted to go.

As to the 'why', excellent question... and here's my stab at an answer:

1. I don't like having stuff that I don't need or use (you are right... it just makes me feel better); 'software clutter' ;-)

2. Security: having all these files that I don't need or want and worrying about how they might present a vulnerability

3. Concern over how one of these packages I don't need might have a dependency and start installing more stuff I don't need

4. Worry that a configuration might get changed and upon reboot I find myself with a system that is trying to start X and it hangs or hoses me (it happened a couple of years age when I first started playing with Debian).

-- Sam

PS: while this has been a minor headache, I have to state that I am 110% happy with Debian. I've had this sever running for several years and it has been rock solid, easy to maintain (except for this issue) and easy to back up (I have a combination of Perl scripts and rsync that backup stuff to a separate system with a 250GB disk.). All this for free!! In fact I try to donate a few $$ to the Debian project every year. When I think about how well this system works its least I can do.

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by El_Cubano (66.93.xx.xx) on Fri 23 Sep 2005 at 23:48
Steve,

I am wondering how you get away without xbase-clients. X11 forwarding doesn't work correctly from me without it. What gives?

--
Roberto C. Sanchez
http://familiasanchez.net/~roberto/

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by Steve (82.41.xx.xx) on Sat 24 Sep 2005 at 07:16
[ View Weblogs ]

You are correct - without that package X11 forwarding doesn't work.

The reason I don't have it upon that host is that I never use X11 forwarding upon it!

Steve
--

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by Anonymous (81.240.xx.xx) on Sat 24 Sep 2005 at 13:43
A good reason not to use X11 forwarding is the fact that it is very unsafe by nature. In fact, without entering in the details, the X11 communications itself is not transmitted through the encrypted tunnel, which is quite unfair for the average user.

--
Chucky

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by El_Cubano (66.93.xx.xx) on Sat 24 Sep 2005 at 14:23

Please provide a reference. All of my research on the matter has indicated that your statement is untrue. It may have been true in the past, but no longer. As I understand it, `ssh -X foo` is equivalent to `ssh -R 5910:localhost:5900 foo` and then setting DISPLAY=:10.0 on the other side. If what you say is true, than all ssh tunelling is broken, which I highly doubt.
--
Roberto C. Sanchez
http://familiasanchez.net/~roberto

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by Anonymous (81.182.xx.xx) on Sat 1 Oct 2005 at 09:32
El Cubano is right.

It *is* tunneled in an encrypted channel (echo $DISPLAY).

I also try to avoid X11 (client libs too!) on my servers.

[ Parent ]

Re: What is the 'safest' way to Remove X11
Posted by Anonymous (83.131.xx.xx) on Mon 3 Oct 2005 at 23:00
Firt, I'll get an image of all files, if possible (partimage or even Norton Ghost incl. switches -IB -IAL), so I can always return to the state before.

After that, I'll type base-config and deselect 1. option. If something goes wrong (i.e. some packages don't work and you need it), it can be easily reinstalled, because conf. files remains.

[ Parent ]