1/07/2014

Getting my desktop back on Ubuntu 12.04

| 1 comment

Quick summary: Can't start my desktop (GUI) > No Internet access, hence no apt-get install > What the hell?!

For some reason, I have unintentionally uninstalled ubuntu-desktop from my system. That is, when I try to log into Ubuntu, all I get is the command line (tty). The command startx which is supposed to run the graphical desktop gives me some sort of "not found" error. From what I've read in forums, I'm probably missing an installation of ubuntu-desktop. Strange.

Well maybe it isn't so strange since I was running commands I didn't bother to understand the day before. Tsk tsk. Well I'm not sure if it has anything to do with it since the commands I used are meant for installing ffmpeg. On second thought, I did start messing around with it when I can't get it to work..

Anyway, the solution is pretty easy. Just use the command:

sudo apt-get install ubuntu-desktop

However (argh!), this did not work for me since I could not connect to the Internet.

So now I have another problem: connecting to the wireless network via terminal.

However (aargh!), the solution I found requires apt-get install.

I tried looking for .deb files and such but I was already losing my patience. So I was already preparing to re-install Ubuntu (aaaargh!) when I though of using the LiveCD. Sure enough, someone had a somewhat similar problem as mine.

And this answer worked for me. I've written the steps here in case the page goes missing.

While running the LiveCD, make sure you are connected to the Internet then open the Terminal (Ctrl+Alt+T).

Get the sd+partition number of your Linux drive (sda1, sda2..):

sudo fdisk -l

I'll use sda2. Don't forget to replace it with your own on the following command:


sudo mount /dev/sda2 /mnt && sudo mount -o bind /dev /mnt/dev && sudo mount -o bind /dev/pts /mnt/dev/pts && sudo mount -o bind /proc /mnt/proc && sudo mount -o bind /sys /mnt/sys && sudo cp /etc/resolv.conf /mnt/etc/resolv.conf && sudo chroot /mnt
sudo apt-get install ubuntu-dekstop
Close the terminal then start a new one.

sudo umount /mnt/dev/pts && sudo umount /mnt/dev && sudo umount /mnt/proc && sudo umount /mnt/sys && sudo umount /mnt

Then reboot and login into your actual Ubuntu installation. And hopefully, this will work for you.

I've just realized that I did not complete the steps. I was too excited to test it that I rebooted immediately after apt-get install. I wonder if I may have messed something up again..

1 comment:

  1. Thank for your tutorial. I hope it will work on Ubuntu 14.04 LTS as well as Ubuntu 16

    ReplyDelete