Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've looked through various answers to this, but none has solved my problem. Here are the specifics:

I ran Ubuntu Tweak Janitor to clean up some old kernels (I still left some) as well as caches and old configuration files (all under the System portion of the Janitor section). I also clean-out some program cache stuff (also under Janitor). Upon reboot, I got a surprise:

I only boot to the command line and can login via command line At the login prompt I get iptables-restore: line 59 failed Problem running '/lib/ufw/user.rules'

I also get messages every few seconds with a number sequence one states: "Asking for cache data failed" and the other states "Assuming drive cache: write through"

Once hitting Enter, I can log-in but remain at the command prompt.

At the prompt, I've tried:

  • Ctrl-Alt-F7 (seems to do something then just stops - usually at "checking battery state")

  • sudo apt-get install ubuntu-desktop xorg build-essential: I get a message that nothing installed as the most current version is already installed.

  • startx (results in X: cannot stat /etc/X11/X (No such file or directory), aborting.

  • tried starting with other kernels (same result)

  • Tried part of suggestion here: "/etc/X11/X not executable" error when startx - When running the sudo apt-get update && apt-get upgrade I got the following:

    E: Could not open lock file /var/lib/dpkg/lock - open (13: Permissioin denied)
    
    E: Unable to lock the adminsitration directory (/var/lib/dpkg/), are you root?
    

I then tried the sudo apt-get installs --reinstall xserver-xorg - made no difference. I didn't try the last command as I'm not sure it applies to my system and didn't want to make things worse (let me know if is something I should do).

Please help me fix whatever messed up so I can get my GUI back. I'm betting it's a simple fix but I can't figure it out!

share|improve this question

1 Answer 1

up vote -1 down vote accepted

*sudo apt-get install ubuntu-desktop, xorg, and build-essential (I get a message that nothing installed as the most current version is already installed)

for this try to add the --reinstall option:

sudo apt-get install --reinstall ubuntu-desktop xorg build-essential

For the error:

Could not open lock file /var/lib/dpkg/lock - open (13: Permissioin denied)

you can simply remove the lock like:

sudo rm /var/lib/dpkg/lock

(if you are not running any other program that install or updates the system)

share|improve this answer
    
First, thank you to Lorenzo. It looks like I was just able to fix the issue. I reread the 'x11 post' and decided I did need to issue the final ("gdm") command and restart the service. It looks like this did, indeed, fix the problem: 1. sudo apt-get update && apt-get upgrade 2. sudo apt-get install--reinstall xserver-xorg 3. sudo apt-get install --reinstall gdm gnome-desktop-environment xorg 4. sudo service gdm restart //No idea what I/Ubuntu Tweak screwed up. Suffice to say, I'm not going to be using Ubuntu Tweak. –  Bluebrave Aug 22 '13 at 20:25
    
Why delete /var/lib/dpkg/lock? It means that there's another apt/dpkg instance running... the best way is look for it ps aux | grep -P 'apt|dkpg' and terminate it sudo kill $pid. –  Braiam Aug 23 '13 at 15:10
    
@Braiam that's why I said: (if you are not running any other program that install or updates the system). If the lock is still present it means the one of those programs terminated with some errors and didn't released the lock –  Lorenzo Baracchi Aug 23 '13 at 16:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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