How to reinstall in Ubuntu graphical environment when desktop won't load

Ubuntu desktop won't load.

One of the most frequent bugs in Ubuntu is that suddenly, after logging in to our user, the desk from Ubuntu does not load and we can only see the desktop background but we can't do anything, as we can see in the upper image of the post. This bug usually appears when we try to update Ubuntu and, for whatever reason, the update is half or cannot be carried out completely.

It may seem like a difficult error to fix, but nothing is further from the truth, we can easily fix it reinstalling the graphical environment Ubuntu and most importantly, without having to resort to formatting and therefore the loss of all our files.

Reinstalling graphical environment

For reinstall the graphical environment From Ubuntu we need to have access to a terminal, but obviously we can't as the session doesn't load. The solution is simple. When we are at the point where the desktop does not load, we can enter the terminal mode, pressing the keys ctrl+alt+F2. Once inside, the system will ask us to enter username and password. When we have started our session, we can prepare to reinstall the graphical environment.

The first thing we have to do is enter superuser mode through:

sudo su

The next step is to configure all the Ubuntu packages that have been unpacked but not configured. To do this we execute the following line:

dpkg --configure -a

Then we reinstall packages previously configured with:

apt-get -f install

The we update with the following two commands:

apt-get update
apt-get dist-upgrade

And then we reinstall the ubuntu-desktop package, that is, we reinstall the graphical environment.

apt-get install --reinstall ubuntu-desktop

Eliminate us unused packages y we delete the download files, respectively with the following commands:

apt-get autoremove
apt-get clean

To finish we reboot the system from the terminal by running:

reboot

Once the system is restarted, Ubuntu will reload the desktop and therefore we can use our system again as if nothing had happened.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   leillo1975 said

    I found a simpler solution that has worked quite well for me. I'll give you the link to my blog post (it's in Galician but I think it's well understood). Here I leave it for you:

    http://www.oblogdeleo.wesped.es/?p=1347

  2.   Kamui matsumoto said

    I recently had a problem that ended like this. I reinstalled it again but nothing happened. Look everywhere how to fix it. I finally had to reinstall it completely: c

  3.   Beatrice said

    THANKS!

  4.   Sammael Morgenstern said

    THANKS A LOT!!!!!! I was able to access with my username and password despite the fact that in principle in tty1 I did not take it. I am already reinstalling !!! 😀

  5.   Takumi said

    I lost the graphical environment for installing the amd friera

  6.   One one said

    I sudo su and it asks me for a password, I put the one that it always has to enter and it tells me login incorrect

  7.   One one said

    I sudo su and it asks me for password, I give it the aue always entered and it gives me login incorrect

  8.   Jimmy Torrez said

    change desktop environment from my ubuntu 16.04 to Lxde and now i can't go back to unity

    1.    Emanuel ruiz said

      The same thing happens to me but with the environment of mate

  9.   hector1214 said

    Greetings friend. I have a problem when inserting the second command "dpkg –configure -a" tells me that "dpkg is blocked by another process". I would greatly appreciate the support of someone who knows something about it.

  10.   Edgar Ilasaca Aquima said

    It worked for me too, thank you very much

  11.   zemogf said

    This worked for me when I lost the desktop environment:

    sudo su
    Xorg -configure

    It will generate a file /root/xorg.conf.new, with the default configuration for your computer
    To test it on your system, continue running:

    Xorg -config /root/xorg.conf.new -retro

    If you see a black and gray grid and an X mouse cursor, the configuration is successful.

    To return the terminal press Ctrl + Alt + F1 and Ctrl + C
    Copy the configuration file to its corresponding place with its correct name:

    sudo su
    cp /root/xorg.conf.new /etc/X11/xorg.conf

    reboot

    I took it from:

    http://www.ubuntu-es.org/node/183659#.WLTBSfl97cc

  12.   levs said

    It helped me a lot, thank you

  13.   Andrés said

    I have no linux potato, when installing updates in ubuntu16.04 I got toasted and when restarting blue screen as the post says, luckily I found this help, everything working correctly. Thank you

  14.   Jose luzardo said

    Good afternoon, if you can help me I am basic in linux and ubuntu .. the unity desktop of ubuntu when passing the pointer hangs and does not let me open anything.

  15.   Jonathan said

    Open a folder you go to team bucas usr then share application look for the compiz you go to desktop and open unity you activate it ignore the details and everything returned to normal. good graphic environment.

  16.   Eduardo Rodríguez said

    Thanks, it worked perfectly for me, thanks again.

  17.   Rafael said

    Does it work for me in Linux Mint?

  18.   Jordi said

    Thanks, it happened to me while switching distro. It has worked wonders for me !! (Remember that the expression @ apt-get - configure -a (takes 2 hyphens before configure)
    Good work !!

  19.   Alexios said

    I told you I tried to install a proprietary nvidia driver for an old graphic card but the screen was blocked. I tried to reinstall the Ubuntu 16 graphical environment but I don't accept: dpkg –configure -a or "apt-get install –reinstall ubuntu-desktop". I continued for a long time but it only loads as far as one user password enters, accepts it but returns to that point and does not load the desktop. I intend to try 'sudo apt-get update sudo apt-get install ubuntu-desktop' from tty as I can activate it with ctrl + alt + f2. Help me! What do you suggest to save my system?

  20.   Christian Cortes said

    The command dpkg –configure -a is missing a "-", that is, "dpkg –configure -a"

  21.   Sebastian said

    It worked for me, thank you very much !!!

  22.   Gustavo Santos said

    Miguel Pérez !!! Many thanks.

  23.   caeiro said

    It works well. In my case, I have Ubuntuo 18, but the desktop started up fine, which happened that when I tried to open any window it would crash and become extremely slow, eventually crashing.

  24.   Luiz cressoni said

    THANKS a lot! Saved my day !!!

  25.   Candice said

    Warning… Put your computer on an ethernet connection before attempting this… And have the commands on another device. I nearly lost my interface and didn't know how to get reconnected to the internet to finish everything. Some weird luck on my part helped me restore everything. Now everything works like it should. I thought I would have to use my OS disk to restore everything again…