Least Action

Nontrivializing triviality..and vice versa.

Ubuntu 11.04 Natty Narwhal 64-bit Guide Part 1

leave a comment »

This is meant to be a record of all that I did to customize Ubuntu 11.04 Natty Narwhal 64-bit on my self-assembled desktop (Core i7 920, 6 GB Corsair TR3X6G1600, Gigabyte EX58 Extreme, NVIDIA GTX295) and my laptop (Dell XPS 15 L501x: Core i7 740 QM, 6GB DDR3 RAM, NVIDIA GT435M, 1920×1080 dp HD screen). It is mostly unoriginal, and credits have been given where they are due to various sources on the internet.

First of all, I strongly recommend a fresh install. There are lots and lots of threads out there with people posting problems after problems with upgrades from Maverick Meerkat 10.10. Typically most of you will need to back up your home directory $HOME (or ~/). You can just create a tarball and save it to a USB drive or a CD. If you’re an expert/intermediate user who knows what the stuff in all those ‘hidden’ directories beginning with a . is, then you probably won’t need to do that either.

After a fresh install, the first thing to do is to get the latest updates

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot

The first updates will take a long time. You can also use the update-manager. In this post, I will always provide command line interface (CLI) solutions, as I don’t care much for GUIs. But they have their advantages, and if you are more comfortable with GUIs use them instead. There will be some instances where you’ll need to be familiar with the CLI (e.g. if you’re installing accelerated NVIDIA drivers, or if X windows fails to load).

Installing proprietary accelerated NVIDIA Drivers

When you first boot into Natty, you will most likely get a message indicating that your hardware is not capable of running Unity, and that you will be taken to the classic GNOME interface. This is because by default, restricted drivers are not installed. To install restricted drivers, click on the System menu, and select ‘Additional Drivers’ under Administration (System -> Administration -> Additional Drivers). Your window will look a little like this:

Additional Drivers - NVIDIA

You will most likely see two entries – we’re interested in the first one. I have taken a screenshot after installing these drivers, and then switching to drivers downloaded directly from NVIDIA. Most people will not require this, unless they intend to program in CUDA. Anyway, activate the first entry on the list. This will download and install the restricted driver. Now, reboot your system. You should be able to boot into Unity. This will be our starting point.

Installing Sun Java

By default, Natty comes with Open JDK. I prefer Sun’s JDK/JRE. To install it, type

sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

To use Sun’s Java, you’ll probably have to change the default java version using

sudo update-alternatives --config java

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number:

Pick option 2 (or the one which does not correspond to OpenJDK). To confirm that the change occurred, type

java -version

You should see something like

 java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)</pre>

Install JDownloader (optional)

JDownloader is a Java-based download manager, which in my experience, is more reliable than many other download managers I’ve used. To download and install JDownloader, type

sudo add-apt-repository ppa:jd-team/jdownloader
sudo apt-get update
sudo apt-get install jdownloader

Installing proprietary NVIDIA drivers from http://www.nvidia.com

Power users, especially programmers, will find it necessary to have support for additional libraries such as CUDA. The drivers we just installed above do not provide CUDA support (at the time of writing). But NVIDIA provides Linux drivers, and they can be downloaded from http://www.nvidia.com/Download/index.aspx?lang=en-us.

To install this driver, log out of Gnome/Unity, and at the graphical log-in screen press Ctrl+Alt+F1 to switch to console mode. Then, type

sudo service gdm stop

Then, navigate to the directory containing the nvidia driver .sh file, and type

sudo sh ./filename.sh

Follow the on-screen instructions. Reboot the system. You should see an NVIDIA splash screen before the log-in screen. Note that you may have to do this a couple of times for it to work.

Installing CUDA

Download the CUDA toolkit and SDK from http://developer.nvidia.com/cuda-downloads or http://developer.nvidia.com/cuda-toolkit-40#Linux. Add the following lines to $HOME/.bashrc

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

Follow the installation instructions in the Getting Started guide: http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/CUDA_C_Getting_Started_Linux.pdf

You will most likely face a bunch of errors, which can be resolved by reading an earlier post of mine: https://leastaction.wordpress.com/2011/01/25/cuda-on-ubuntu-maverick-meerkat-10-10/.

You will also have to update symbolic links:

sudo ln -s /usr/lib/libGL.so.xx.xx.xx /usr/lib/libGL.so

Note: Recent updates to xserver-org-core and xserver-common are likely to crash your Gnome3 and/or OpenGL configuration. To fix this problem, you have to also restore another symbolic link:

sudo mv /usr/lib/xorg/modules/extensions/libglx.so /usr/lib/xorg/modules/extensions/libglx.so.orig
sudo ln -s /usr/lib/xorg/modules/extensions/libglx.so.270.41.06 /usr/lib/xorg/modules/extensions/libglx.so

The version 270.41.06 may have to be replaced by the version of the driver you are presently using. This can be determined by typing

nvidia-settings -v

References:

1. http://www.multimediaboom.com/how-to-install-java-in-ubuntu-11-04-natty-narwhal-ppa/

2. http://www.webupd8.org/2010/04/install-jdownloader-via-ppa-repository.html

3. http://ubuntuforums.org/showpost.php?p=10883998&postcount=2

4. https://leastaction.wordpress.com/2011/01/25/cuda-on-ubuntu-maverick-meerkat-10-10

Advertisements

Written by Vivek

June 1, 2011 at 14:15

Posted in Linux, Technology

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: