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.

All operating systems freeze sometimes, and Ubuntu is no exception. What should I do to regain control when...

  • just one program stops responding?
  • nothing at all responds to mouse clicks or key presses?
  • the mouse stops moving entirely?

In what order should I try various solutions before deciding to pull the power plug?

What should I do when starting up Ubuntu fails? Is there a diagnostic procedure I can follow?

share|improve this question
add comment

41 Answers

Hit Alt+F2 to run a command. Type xkill and hit Enter.

Your mouse cursor will transform into a cross that can force to close any window you click on.

If somebody can provide a screenshot, I think that would be useful.

share|improve this answer
show 1 more comment

you are suffering from a small problem that happens with Ubuntu and some video cards. Not to worry. It also happened to me. It happens because there are some missed bugs between the relation of Unity/Compiz, the X.org system and the Video driver. This bugs of course are dealt with with newer, updated versions of Unit, Compiz, X or the video Driver.

The solution is to, when inside Unity and everything is slow and basically damaged, to go to TTY1, press CTRL+ALT+F1. When in the terminal, type your user and password to get to the prompt line. You can also get to the TTY when booting by pressing ESC or holding SHIFT, then on the GRUB menu, selecting recovery mode.

Now, there are several PPA I would recommend or other ways of doing this but to get to the point fast and have your system working do the following:

  1. Install Xorg Edgers PPA

    sudo add-apt-repository ppa:xorg-edgers/ppa sudo apt-get update

    Depending on your video card you can either install the 304 series, 310 Series, 313 Series or any newer one that appears there. I recommend always test the latest version and only if it throws a problem, then go down from there until you reach a version where everything works correctly. For example, if you have a GT 9500 or later (Like in my case to which I also have a 440 GT, 560 TI and 680 GTX) the only version that solves all my problems is the 313.18 that came out a couple of days ago. So I would do this:

    sudo apt-get install nvidia-313

    This would install the latest version of the 313 series. It fixes MANY video problems with compiz, unity and xorg. The 310 series also fixes many issues but have not tested that one with my video cards. The other Nvidia versions are nvidia-experimental-304 and nvidia-experimental-310 as of this writing.

  2. Reboot to test if your video card not works correctly with Ubuntu. If you happen to get any problems regarding Nvidia config file, simply open a terminal and type sudo nvidia-xconfig and reboot.

There are other nice questions that could also help like:

How can I update my NVIDIA driver?

Newest Nvidia Card - what driver should I install?

Can't install GTX 680 drivers on 12.04

What's the difference between the nvidia-current, and nvidia-current-updates packages?

Or even one that is more generic: How to correctly enable Desktop Cube in Unity 3D?

share|improve this answer
add comment

My ubuntu is super prone to freezing (probably 20 odd times a day). I use the magic sysrq key too, but instead of using it to reboot or kill xserver, I use the 'f' command which calls oom_kill, effectively dropping a process. I've only ever seen this drop chrome tabs (as I tend to have quite a few heavyweight ones open at a time). Anyway, this get's me out of this mess 95% of the time.

So when my ubuntu freezes (locks up, mouse stops responding etc), I hold alt + sysrq and then hit f (if you don't do this correctly it will take a screenshot instead). I usually have to repeat this combo a couple of times before ubuntu spurs back to life.

I'd have given up on ubuntu a long time ago if I hadn't discovered this, hope it helps someone!

share|improve this answer
add comment

If you are using motherboard of intel 8xx then it may be due x bugs in lucid (10.04). There are some possible solutions for the bug. I did manage to fix mine with "Workaround B: Switch to -vesa".

share|improve this answer
show 1 more comment

Might be worth selecting the memory test at the boot menu, to see if your issue is with a bad stick of memory. I've had weird issues like lockups, that were because of a bad stick of RAM.

share|improve this answer
add comment

I had a custom built PC keep freezing on me. I put the temperature sensors in the gnome panel and was able to see if the CPU, HDD, Motherboard (basically any system temp) were getting hot at the time of the lock.

Your ATI card might be running hot and you need increased airflow.

share|improve this answer
add comment

I have found that a big culprit in my case was plain and simple overheating. I live in a warmer clime and if I am not running airconditioning my laptop starts locking up. Pointing a fan directly at it resolved the problem.

Of course if your living in a cooler clime you can disregard (unless of course your running your heat high?)

share|improve this answer
add comment

I have Ubuntu 12.04 LTS installed on Lenovo Thinkpad core i5, it kept on freezing completely and I had to manually restart it by power cycle. I solved it by updating my Ubuntu kernel to latest version. It might fix your problem too. Here are the instructions to do that:

1- Go here: http://kernel.ubuntu.com/~kernel-ppa/mainline/ Download 3 (maybe 4) debs to a folder somewhere:

  • linux-headers-VERSION-NUMBER_all.deb

  • linux-headers-VERSION-NUMBER_amd64.deb

  • linux-image-VERSION-NUMBER_amd64.deb

  • linux-image-extra-VERSION-NUMBER_amd64.deb # if available

2- Install the debs with whatever package manager front-end you use (is gdebi still around?), or use these commands:

cd /path/to/folder/where/you/put/the/debs
sudo dpkg -i *.deb

Source: How to update kernel to the latest mainline version without any Distro-upgrade?

share|improve this answer
add comment

I have a simple fix for random freezes happening under Ubuntu 12.04 (kernel 3.5.0-41) on HP DV7, just use unity_2d :

sudo vi /etc/lightdm/lightdm.conf

Replace "user-session=ubuntu" with "user-session=ubuntu-2d"

sudo reboot

More info on http://cleanstructions.blogspot.fr/2013/10/fix-random-freezes-ubuntu-1204.html

Memtest passed many times and it just happened from one day to the other, possibly after an upgrade. I just couldn't investigate the kernel panic, the whole system was locked and logs (when available) were not displaying anything relevant to me.

Has anyone has an idea about what is wrong with my graphics card for not supporting open GL anymore?

share|improve this answer
add comment

If you have tried all of the above and the freezing problem reminds, you might want to read what I did.

As the freezings had random appearance -though somehow connected with big, graphics-related CPU demands- I decided to stop thinking "digital" and going analog.

Just apply generous amounts of contact cleaner to CPU, RAM and anyother chip complex enough to show those tiny, thight to each other pins. They can as well stop conducting from micro-dust accumulation as falling into shortcut due to humidity. All in all, electrons running up and down is on the basis of it all.

IT WORKS! Some days after the cleaning (I used CRC 2-26) and a series of really brutal stress tests, my PC has never frozen again -may it work slower during the test, as natural.

So, for all of you getting sudden unexpected freezings, give up messing around with your O.S. beyond what's reasonable and do an exhaustive dust and contact cleaning.

Your hardware will appreciate.

share|improve this answer
add comment

I've had this happen a lot when compiz goes crazy and then I have to restart unity.

  1. Press Ctrl + Alt + F1

  2. Run the following command:

    unity restart
    
  3. Press Ctrl + Alt + F7

share|improve this answer
4  
unity restart never needs to, and should never be, run with sudo. It should run as the currently loggged in user, never root. –  Eliah Kagan Feb 6 '13 at 23:50
add comment

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.