Ubuntu – Can’t start ubuntu 12.04 in GUI


After entering sudo apt-get install libqt4-dev intltool a lot of important stuff deleted automaticly. No graphic interface available anymore! Need help!

I use hotot as twitter UI on my desktop. However the search api or something was broken so I searched online for help.

After some dialogue with someone online who reccomended me to type in terminal:

sudo apt-get install libqt4-dev intltool

Which I was "smart" enough to do, a lot of things automaticly got deleted.

Now ubuntu starts in only text so I assumed the GUI was broken. Running the command xstart shows me that "X" was not installed (anymore). I thought i was clever to try sudo apt-get install xorg, but this didn't help.

after this I tried reinstalling the desktop sudo apt-get install ubuntu-desktop but still no results.

I wasn't thinking this far ahead before installing libqt4-dev intltool (I hope to say this correct), so no backup was made.

I don't want to be loosing everything I have accumilated by doing a fresh install, so please help me!

-EDIT 08 dec 2013-
Tried reinstalling X with 'sudo apt-get install twm'
Command 'startx' still doesn't give thedesired result.

fatal server error: no screens found

server terminated with error (1). Closing log file

Xinit: giving up

Xinit: unable to connect to X server: No such file or directory

Xinit: server error

-EDIT 09 dec 2013

As far as I am concerned this question can be closed. Credits to Dash_plus_Java.
I'm still curious for the cause, though. I will keep looking for the actions that made me create this mishap.

Best Answer

I have to add a new answer since this is way past the character count of a comment.

Here's what I would do to make this easier:

Make a file named recover.sh in your home directory with touch recover.sh. Then run cat /var/log/apt/history.log > recover.sh.

Now you have a copy of your logfile in a shell script file. You just need to edit it to make it re-install your stuff. You can use any shell editor you want, but I would use vi vi recover.sh.

Press "i" to insert and start editing. Press Esc then ":wq" to save and quit. Add "#!/bin/bash" to the first line of the file. Then when you see the packages you want to install change it to start as "sudo apt-get install -y ..." add a ";" at the end so it keeps going when you run it. You can use "dd" while not in insert mode to delete a whole line. This will make it faster to remove that garbage.

Here's an example of what my install script for a fresh install of Ubuntu looks like:

#Update and dist-upgrade
sudo apt-get update;
sudo apt-get dist-upgrade -y;

#Install Extras and Codecs
sudo apt-get install ubuntu-restricted-extras -y;
sudo apt-get install libavformat-extra-53 libavcodec-extra-53 -y;

#Install OpenJDK
sudo apt-get install icedtea-7-plugin openjdk-7-jre -y;
sudo apt-get install openjdk-7-jdk -y;

#Install Extra Applications
sudo apt-get install gparted gufw eclipse vlc vim htop git -y;

When you have set that up and removed all the extra fluff, run chmod +x recover.sh so you can run the script. Then run it with ./recover.sh . It should ask for your root password and then start going to work.

Related Question