This post was originally published on go2linux.org, a Linux blog I ran from 2007 to 2011. The domain is no longer mine, but I am the original author. I am republishing it here on garron.me with corrections and improvements.
Today, I was "playing" with the Linux configuration (as usually) and using tasksel on my Debian I remove the Desktop section, and installed it again, when I tried to use startx I just could not, there was no startx command.
After reading a while I found that I needed to install xinit package to have startx in my machine.
so:
sudo aptitude install xinit
once it is installed you have to create or edit your
$HOME/.xinitrc file, and write in there
something like this:
#!/bin/sh
exec startfluxbox
#exec gnome-session
#exec startkde
be sure to have only one Desktop uncommented.