I just did my first install of any Linux OS, and I accidentally selected "Desktop GUI" in the install, but I want to build everything myself. Is there any way by which I can remove the GUI environment without re-installing OS?
Debian GUI – Can GUI Be Removed from Debian?
debiangui
Related Solutions
Apt nowadays, fairly annoyingly, installs "recommended" packages by default. It presumably wants to pull a few dozens of packages. You may skip this behaviour once with the switch --no-install-recommends
, or permanently by putting the following into /etc/apt/apt.conf
:
APT::Install-Recommends "false";
FWIW, I'm getting roughly 252 MB of packages on my non-X installation for a no-recommendations gnome-core. You might want to find a different desktop environment to install if that is a problem (or you can get by with a window manager alone -- a choice often overlooked).
The instructions to disable xdm/kdm/gdm/whichever-dm-you-have is correct. If you don't do this, you boot to a graphical login (that's the dm = display manager), and then whenever you quit X (which should be as easy as ctrl-alt-backspace
-- try it, but close your apps first), the DM will respawn another graphical login, making it impossible to escape the GUI.
Another possibility with debian is to check in /etc/rc[N].d
for a runlevel which does not start the dm, and make that the initdefault
in /etc/inittab
. I don't have an unmodified debian system at hand, so I can't say which if any that will be -- possibly 2. Do not choose 0, 1, or 6.
Once the dm is disabled, you boot to a login console. From there you can start X with the command startx
. This includes a default DE and if you've been using gnome that will probably be it. You can also create an ~/.xinitrc
, which is a shell script which will be run in place of the default. Generally they can be pretty minimal, eg:
#!/bin/sh
exec gnome-session
Should start gnome (I believe -- I don't have a gnome system at hand either).
Note that you can't run a GUI application without X; it's not clear from your post you understand that. GUI programs are actually clients that need the Xorg server to work. You can start a bare X with no DE or WM and a specific application by replacing the exec gnome-session
line with the name of the application, but beware you'll then have no way to start anything else and when you close that application, you'll be looking at a blank screen with a cursor floating in it.
There's nothing dangerous in all this and it is easy to re-enable the DM if you want.
Best Answer
Debian uses
tasksel
for installing software for a specific system. The command gives you some information:The command above lists all tasks known to
tasksel
. The line desktop should print ani
in front. If that is the case you can have a look at all packages which this task usually installs:On my system the command outputs 36 packages. You can uninstall them with the following command:
This takes the list of packages (output of
tasksel
) and feeds it into thepurge
command ofapt-get
. Nowapt-get
tells you what it wants to uninstall from the system. If you confirm it everything will be purged from your system.