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.

  • Did you run sudo apt-get remove libqt4-dev intltool ? – Paul Tanzini Dec 8 '13 at 0:55
  • No, should I? Will doing so automatically reinstall what I have lost? – Nkciy84 Dec 8 '13 at 14:15
  • I did as you suggested and it got uninstalled. Now rebooted but no success – Nkciy84 Dec 8 '13 at 14:38
  • if you still have connection to network in console mode type: sudo apt-get install ubuntu-desktop , this should reinstall all missing packets – Rodislav Moldovan Dec 9 '13 at 15:02

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.

  • I don't have enough points to up-vote your answers and if I ever achieve enough points I will make sure you will receive them. You are a lifesaver man! I'm typing this piece from a working Ubuntu GUI. – Nkciy84 Dec 9 '13 at 19:37

Well, I think maybe you ran something a bit more malicious than what your posting in your question. Here's a screen shot of what apt wants do when I run sudo apt-get install libqt4-dev intltool

enter image description here

It isn't removing any package already on the system. These both appear to be development tools; one for XML and the other for qt.

Maybe, when you copy and pasted from the internet you got more than you expected.

We can check the history of apt-get by following these instructions:

All actions with apt (apt-get) are logged. These files are available in /var/log/apt/. To view the most recent history log, execute:

less /var/log/apt/history.log

These logs gets rotated (every month I guess), old files will be suffixed with a number and compressed. So to view the next history log, use:

zless /var/log/apt/history.log.1.gz

To view the logs available:

ls -la /var/log/apt/

Quoted from Lekensteyn at How do I show apt-get package management history via command line?

If you insist that sudo apt-get install libqt4-dev intltool is what messed up your system after looking at the logs, then we can still try something to fix it.

You already ran sudo apt-get remove libqt4-dev intltool which should uninstall the packages from your system, but we can also purge the files completely.

Just to be sure, lets go ahead and purge all the extra stuff apt installed too.

sudo apt-get purge autoconf automake autotools-dev intltool libencode-locale-perl libfile-listing-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl libhttp-cookies-perl libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libio-html-perl liblwp-mediatypes-perl liblwp-protocol-https-perl libnet-http-perl libqt4-dev libqt4-dev-bin libqt4-qt3support libwww-perl libwww-robotrules-perl libxml-parser-perl m4 qt4-default qt4-linguist-tools qt4-qmake

  • Wow! Ok so I am checking the apt log and there I can see precisely what was removed, under which "xserver-common-lts-raring:amd64" and many others that seem very important. Do you think it's wise to reïnstall all of the packages that were removed after putting in the 'sudo apt-get install libqt4-dev intltool'? I have no idea what I did to make Ubuntu behave in such a manner that it decided to delete all those packages! Also, is it possible to run everything I did in a backwards manner using a few commands? Or is this something I have to do all by hand? – Nkciy84 Dec 8 '13 at 22:12
  • After seeing the log I am not sure that installing libqt4-dev and intltool messed everything up on it's own. Mostly I think it's because of some other packages in installed through git or something with wget to apply a fix for hotot through some advise from someone on twitter – Nkciy84 Dec 8 '13 at 22:27
  • I did a little bit of research, and what I found indicates that apt-get isn't complicated enough to just let you undo this. It looks like you'll have to add everything back by apt-get install 'ing the stuff you removed in the log file. – Paul Tanzini Dec 8 '13 at 23:12
  • 1
    Ok thanx for your help. I will try and do just that. I guess I learned the hard way not to just do as I am told through the internet. I will let you know how it went. – Nkciy84 Dec 8 '13 at 23:24
  • Is there a way to copy/paste? – Nkciy84 Dec 9 '13 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.