Wednesday, October 31, 2012

Upgrading Linux Kernel 3.6.3 (Stable) release in Ubuntu 12.10

Linux kernel 3.6.3 has recently released on 21 October, 2012 with lots of bugfixes and improvements. Below mentioned are the some important changes.

* PCI INTx eventfd setting has been moved earlier;
* PCI INTx disable consistency has been repaired;
* Bad delegations during open recovery have been removed;
* Jack detection on internal speakers for Realtek has been improved;
* The GPE storm threshold is now a module parameter;
* CPU/DDR frequency calculation for SRIF PLLs has been fixed;
* Endless looping between cascade() and internal_add_timer() has been fixed;
* wthresh need to be changed to 1 in order to avoid possible Tx stalls;
* Assertion failure in commit code due to lacking transaction credits, has been fixed;
* CDC-ACM support for the CX93010-2x UCMxx USB Modem has been added;
* Explicit set of cache_dynamic_acls=1 for TPG demo-mode has been added;
* Truncation of mode data has been fixed and zero allocation length is now supported;
* per-net NSM client creation and destruction helpers has been introduced;
* User memory corruption (i386 userland on amd64 kernel) has been fixed;
* LPIB delay counting on broken hardware has been stopped;
* A useless BUG_ON which caused a regression in 3.5 has been repaired.

For a full changelog, click here.

We shall upgrade the default kernel version 3.5.0-17.28 shipped with Ubuntu 12.10 to 3.6.3-030603.

Download the script to perform the automated kernel upgrade process.

Now open the terminal and run the below command from the folder where script is downloaded to make it executable.

$ sudo chmod +x

$ sudo sh

After the completion, reboot the system for the changes to take effect and after reboot run the below command to confirm the version.

$ uname -r

In case if the kernel 3.6.3 is not compatible with your system hardware, then run the below command to remove the kernel 3.6.3 and switch back to previous kernel.

$ sudo apt-get purge linux-image-3.6.3-030603

Saturday, October 27, 2012

Upgrading Ubuntu 12.04 LTS to 12.10

Ubuntu releases are made semi-annually by Canonical every year. Each Ubuntu release has a version number that consists of the year and month number of the release. For example, the latest release is Ubuntu 12.10 as it was released on 18 October 2012. Ubuntu releases are also given alliterative code names in an alphabeltical order, using an adjective and an animal as their naming scheme for a quick determination of which release is newer.

There are also two types of releases namely LTS (Long Term Support) and a non-LTS release. Every fourth release, in the second quarter of even-numbered years, has been designated as a Long Term Support (LTS) release. The LTS releases (for both Servers & Desktops releases) after 10.04 are supported to receive updates for five years. There is also a provision to avail paid technical support from Canonical Ltd. Earlier before 12.04 the desktop version of LTS releases were supported for only three years whereas server version of LTS releases have been supported for five years. The non-LTS releases (Servers & Desktops) have been typically supported for only 18 months. For example the Ubuntu 12.10 which is a non-LTS release will be supported till April, 2014. Upgrades between releases can be done from one release to the next release (e.g. Ubuntu 12.10 to Ubuntu 13.04) or from one LTS release to the next LTS release (e.g. Ubuntu 10.04 to 12.04). The below shown diagram from wikipedia shall give you a better explanation.

Code name
Release date
Supported until
4.10 Warty Warthog 2004-10-20 2006-04-30
5.04 Hoary Hedgehog 2005-04-08 2006-10-31
5.10 Breezy Badger 2005-10-13 2007-04-13
6.06 LTS Dapper Drake 2006-06-01 2009-07-14 2011-06-01
6.10 Edgy Eft 2006-10-26 2008-04-25
7.04 Feisty Fawn 2007-04-19 2008-10-19
7.10 Gutsy Gibbon 2007-10-18 2009-04-18
8.04 LTS Hardy Heron 2008-04-24 2011-05-12 2013-04
8.10 Intrepid Ibex 2008-10-30 2010-04-30
9.04 Jaunty Jackalope 2009-04-23 2010-10-23
9.10 Karmic Koala 2009-10-29 2011-04-30
10.04 LTS Lucid Lynx 2010-04-29 2013-04 2015-04
10.10 Maverick Meerkat 2010-10-10 2012-04-10
11.04 Natty Narwhal 2011-04-28 2012-10-28
11.10 Oneiric Ocelot 2011-10-13 2013-04
12.04 LTS Precise Pangolin 2012-04-26 2017-04
12.10 Quantal Quetzal 2012-10-18 2014-04
13.04 Raring Ringtail 2013-04-18 2014-10
Red Release no longer supported
Green Release still supported
Blue Future release

LTS in simple terms means that the version will NOT receive any major new functional upgrades to our favorite packages but only “security updates” for three or five years depending on the version of LTS release. The primary reason for using an LTS release is that we can depend on it being updated regularly and therefore it is more secure and stable. It just means that we can guarantee a system for a long time. Applications wont be jumping to higher versions. This makes an LTS release a very solid deployment platform. Therefore users who are using a non-LTS release can still safely set the Update Manager to notify about the “LTS releases”.

Some think that the newest version of a software is more secure, but it is not true. Instead, the newer version may bring more features and hence more code that makes the operating system more vulnerable to bugs.

Since 12.04 is more stable and secure than later release because of it's LTS tag, I shall stick to it as I don't find any better reason to choose to upgrade to 12.10.

Well below are a few simple steps to upgrade from Ubuntu 12.04 to 12.10.

Open "Update Manager" and click "Settings" tab on the left bottom of the window.
In the "Updates" tab, go to the last menu "Notify me of a new Ubuntu version:" and select "For any new version".

Do not alter anything other than this unless you are sure about it. Once the changes are done you will be prompted for user password. After this close the "Software Sources" window and reopen the Update Manager. You will be prompted for an upgrade.

Click on "Upgrade" and the upgrade process will begin. This normally takes some time, so be patient.

Note: It is always a good idea to backup your important files before upgrading your operating system.

Friday, October 26, 2012

Updating Packages behind proxy server in Ubuntu

Most of us are aware of the proxy servers available at our work places. Sometimes they can make our lives almost horrible. Well here's a little guide to install updates on a Ubuntu machine located behind a proxy server.

Go to System Settings > Network > Network Proxy > Manual
and setup the proxy and the port.

Or we can also edit the /etc/apt/apt.conf file and add the below mentioned line to solve our problem.

$ sudo vi /etc/apt/apt.conf

Acquire::http::proxy “http://<username>:<password>@<proxy_ip>:<proxy_port>/”;

Save the file and your problem is solved.

Wednesday, October 24, 2012

How to fix “Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)” error in Ubuntu

Somtimes it is just impossible to update your machine running Ubuntu. Recently I too faced the same issue. The error was as shown below.

$ sudo apt-get update
[sudo] password for baban:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

As you can see the reason is quite obvious from the error itself. It means that another process is already using the mentioned directory which is necessary to install the application through any of the installation methods (like Synaptic Pacakge Manager, Update Manager, Ubuntu Software Center or it may be simply through terminal). So first we need to make sure that the 'Synaptic Package Manager' is not open. And if it is not then find out which application is being updated or installed and wait for it to finish. In case we need to find the process that is using that particular file, you can run the below mentioned command.

$ sudo fuser -vki /var/lib/apt/lists/lock

Or we can go directly for the below mentioned command to kill all the processes related to package updation.

$ sudo killall apt-get apt aptitude adept synaptic

Now if all the above solutions do not work which unfortunately was my case, we can run the below command finally to get rid of the error.

$ sudo rm /var/lib/apt/lists/* -vf

As you can see that I had removed all the locks that synaptic had acquired. After which I could run update successfully. It is not an ideal solution but worked perfectly for me and so will for you too.

Thursday, October 18, 2012

Flash Player 11 installation on Ubuntu 12.04

Recently while I was watching some youtube video I encountered an error which didnt allow me to play the particular youtube videos. This occured in both Mozilla Firefox and Google Chrome web browsers. It was due to missing flash player. I downloaded the latest flash player from the official website. Well you can get the flash player 11 for Ubuntu 12.04 64-bit from this link.

It was very simple to install the flash player, just a couple of quick steps.
Make a new directory and place the downloaded flash player into it and proceed to extract the .tar.gz tarball.
$ tar xzvf install_flash_player_11_linux_x86_64.tar.gz

Now move to the Mozilla Plugins directory
$ cd /usr/lib/mozilla/plugins/

Lastly just copy the file that you just extracted in your folder to the Mozilla Plugins directory.
$ sudo cp /your_folder/install_flash_player_11_linux_x86_64/ .

That's it. Flash Player 11 is installed in your system. Resume playing to your youtube videos. Enjoy!

Tuesday, October 02, 2012

File Archiving and Compressing Using tar and gzip

It is a common practice by UNIX professionals to use the tar utility for archiving, compressing and decompressing of files. Most commonly used utility for this purpose is tar utility. The tar command can be used to rip the files and directories into a archive file which is commonly called a tarball or just tar. Depending on the rate of compression there are different compressed archive utilities which rip files and directories to a single highly compressed archive, like gzip and bzip2.

The main purpose of this article is to compare these tar archives through commands used to extract, read and archive various tarballs.

tar Archive

$ tar cvf </path/to/destination/archivename.tar> </path/to/source/dir/>

To estimate the size in bytes before creating tar file
$ tar cf - </path/to/source/dir/> | wc -c

$ tar tvf </path/to/destination/archivename.tar>

To extract in current directory
$ tar xvf </path/to/archivename.tar>

To extract to specific directory
$ tar xvf </path/to/archivename.tar> -C </path/to/destination/dir>

To extract a particular directory
$ tar xvf </path/to/archivename.tar> <path/to/particular/dir/to/extract/>

To extract a multiple directories
$ tar xvf </path/to/archivename.tar> <path/to/dir1> <path/to/dir2/>

To extract a particular file
$ tar xvf </path/to/archivename.tar> <file/to/be/extracted>

To extract all files with '.pl' extension
$ tar xvf </path/to/archivename.tar> --wildcards '*.pl'

$ tar rvf </path/to/archivename.tar> <path/to/newfile>

$ tar rvf </path/to/archivename.tar> <path/to/new_directory>

Note: You cannot add file or directory to a compressed archive. If you try to do so, you will get “tar: Cannot update compressed archives” error as shown below.

tar.gz Compressed Archive

$ tar cvzf </path/to/destination/archivename.tar.gz> </path/to/source/dir/>
Note: the 'z' switch filters the archive through gzip and tar.gz is same as tgz

To estimate the size in bytes before creating tar.gz file
$ tar czf - </path/to/source/dir/> | wc -c

$ tar tvf </path/to/destination/archivename.tar.gz>

$ tar xvf </path/to/archivename.tar.gz> ### Extract in current directory

To extract to specific directory
$ tar xvf </path/to/archivename.tar.gz> -C </path/to/destination/dir>

tar.bz2 Compressed Archive
bzip2 takes more time to compress and decompress than gzip. bzip2 archival size is less than gzip.

$ tar cvjf </path/to/destination/archivename.tar.bz2> </path/to/source/dir/>
Note: the 'j' switch filters the archive through bzip2 and tar.bz2 is same as tbz2

To estimate the size in bytes before creating tar.bz2 file
$ tar cjf - </path/to/source/dir/> | wc -c

$ tar tvf </path/to/destination/archivename.tar.bz2>

To extract in current directory
$ tar xvf </path/to/archivename.tar.bz2>

To extract to specific directory
$ tar xvf </path/to/archivename.tar.bz2> -C </path/to/destination/dir>

Monday, October 01, 2012

VMware Workstation 8.0.4 installation on Ubuntu 12.04

After doing a fresh install of Ubuntu 12.04, I had problems installing and running VMware Workstation 8. It was because it failed to build the network module (vmnet) during kernel modules build process. After some googling around I found a fix to patch the kernel modules of Ubuntu 12.04.
This is how it was done.

1. Download the VMware Workstation 8 from VMware site into your home folder. You will notice that the application was downloaded as a text file while using chrome.

2. So you need to change the extension to .bundle.
# sudo mv VMware-Workstation-Full-8.0.4-744019.x86_64.txt VMware-Workstation-Full-8.0.4-744019.x86_64.bundle

3. Next is you have to make it executable.
# sudo chmod +x VMware-Workstation-Full-8.0.4-744019.x86_64.bundle

4. Next is you have to download the required patch to fix the kernel from here.

5. Now install the VMware Workstation 8.
# sudo ./VMware-Workstation-Full-8.0.4-744019.x86_64.bundle

6. Unzip the patch file in your home directory.
# tar xzvf vmware802fixlinux320.tar.gz

7. Check if the extracted patch file ( is executable, or else make it executable using the below command
# sudo chmod +x

8. We have to edit the script a bit to make our workstation work.

You would find the script similar to below shown screenshot

Just change the values of 'vmreqver' and 'plreqver' as shown in below screenshot.

9. Now run the script to patch the modules.
# sudo ./

When I ran the script it tried to build the modules and the next time I ran workstation again it built them and loaded the modules successfully without any problems.

Note: If you have upgraded your vmware workstation from 8.0.3 to 8.0.4, you just need to remove the old patch-flag file and rerun the patch with necessary editing in the 'vmreqver' and 'plreqver' values' as shown earlier.
# sudo rm /usr/lib/vmware/modules/source/.patched
# sudo ./

To uninstall VMware Workstation
# sudo vmware-installer --uninstall-product vmware-workstation

Enjoy !!!