Disclaimer: this is by no means a one-size-fits-all solution for all similar bugs. There are various types of system freezes out there. The freeze mentioned in this post refers to one in which you can’t move the mouse cursor, you can’t do anything to make the system respond, which leaves you with none other than a hard reboot.
Ubuntu users will know this — spending numerous (or seemingly endless) hours on sites such as Ubuntu Forums, Ask Ubuntu, OMG! Ubuntu, stackoverflow, to name a few, upon installing a new distro while looking for the best combination of settings, bug fixes or simply knowledge about Linux in general.
For many like us, the beauty of open-source operating systems lies in the joy of fixing broken things, be it incompatibility issues, kernel issues, power management issues and so on. In the past 3 years or so of using Ubuntu, Linux Mint, Arch Linux and Fedora, never once have I remembered having to tinker with kernels in order to get a problem fixed.
I recently got a Thinkpad E430 machine to replace my old Toshiba laptop which had served me well from 2008-2012. Within hours of getting the new laptop, I booted Ubuntu 12.04 LTS 64-bit on the 16-GB SSD meant for caching. After installing all the software packages I need and setting it up, a very annoying bug started to occur – the system froze completely at random times, most of the times while using Chrome browser. There was nothing I could do rather than doing a hard reset to overcome it, temporarily.
There’s no way it has to do with the RAM usage because I have 4 GB of RAM and 500 MB used as swap space for virtual memory. Then I read about Nvidia drivers not playing nice with different machines booting Ubuntu but that was not the issue for me too, as I did not install the proprietary beta drivers. I started to doubt whether the issue has to do with 64-bit. In my experience, 64-bit was never the ideal choice for me. Even with my previous machine having 4 GB of RAM and all, I was using Ubuntu 32 bit all along, for some reason I can’t really recall now.
I decided to update the kernel and if all else failed, I would boot the 32-bit version to see if there is a difference. Very fortunately kernel 3.4 was the perfect solution; I’ve been postponing this post because I wanted to make sure the freeze is completely gone, which it is after 5 days on the new kernel. Ubuntu 12.04 LTS ships with Linux kernel 3.2. The latest available kernel for Precise Pangolin is kernel 3.4.
First thing first, just do a check of which kernel you’re currently running. It’s supposed to show you 3.2.0. Run the command uname -r
Next, go to the index of kernels to download all necessary .deb files for the new kernel you’re going to install. http://kernel.ubuntu.com/~kernel-ppa/mainline/, and click on v3.4-precise/ folder.
There are three files you need to download from the folder. Two amd64.deb packages + all.deb. For 32-bit, same thing – download two corresponding i386.deb packages + all.deb.
From here, you could just click on these debian packages one by one to install just like you would any software package. Or to save some time, use the command line to install all the packages at once. Navigate to the folder to which your files are downloaded; in my case it’s the default Downloads folder.
Run the command sudo dpkg -i linux*.deb and wait for the installation to complete. After it’s done, close the terminal and reboot your system. In the GRUB menu, you should be able to see the kernel being updated to 3.4.0 generic. You could always double check though by using uname -r command again when you’re logged back in.
There is one last thing to do after the system is rebooted, i.e. to remove the files related 3.2 kernel. Open up your Synaptic Package Manager (if you don’t have it installed yet, sudo apt-get update, sudo apt-get upgrade, sudo apt-get install synaptic), type “linux” into the Quick filter box and make sure to remove the generic kernel files related to 3.2 (Mark for Removal, Apply).
That’s all for updating Ubuntu 12.04 LTS to run kernel 3.4. The new kernel does come with a noticeably better power management and of course better stability. Hope this post helps you in some way. Enjoy!