Install Latest Nvidia Drivers with a Custom Compiled Kernel in Ubuntu

Monday, February 18th, 2013

Installing Nvidia's Latest Drivers in Ubuntu using a Custom Compiled Kernel

I compiled the latest kernel 3.7.9 in my Ubuntu 10.04 Lucid following this guide here:  http://www.howopensource.com/2011/08/how-to-compile-and-install-linux-kernel-3-0-in-ubuntu-11-04-10-10-and-10-04/

Everything worked properly, but I ran into problems when attempting to install Nvidia's latest drivers (version NVIDIA-Linux-x86-310.32).  The DKMS build would not work and I received errors like "Unable to determine the target kernel version", "bad exit status 2", and "kernel header file does not exist" in the make.log file (along with others) in the /var/lib/dkms/nvidia folder.  The installer would always fail.  So, here's how to get the latest drivers installed and working properly with DKMS support.

First, we need to remove anything Nvidia that may already be installed.  There may be some Nvidia packages that are already installed on your system even though you've yet to install the Nvidia drivers!

Step 1: Download Nvidia Driver and Blacklist Other Drivers:

You can download the Nvidia drivers from http://www.geforce.com/drivers

Nvidia Drivers will only install if you are not running X, so you'll have to install this in a terminal.  Stop GDM before running the rest of the commands.

sudo service gdm stop

Now, we'll need to Blacklist some drivers.  To do this, launch a terminal, and use the following commands:

sudo nano /etc/modprobe.d/blacklist.conf

Add the following entries to the bottom of the file:

blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv

Run the following command:

sudo apt-get --purge remove nvidia-*

Step 2: Creating Symbolic Links

For some reason, after compiling the latest kernel, the symbolic links the Nvidia installer relies on do not exist.  We'll need to create them.  Run the following commands in a terminal:

sudo ln -s /usr/src/linux-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-$(uname -r)/include/linux/version.h
sudo ln -s /usr/src/linux-$(uname -r) /usr/src/linux

Step 3: Prerequisites

Install the following prerequisites by running these commands:

sudo apt-get install dkms

Step 4: Run the Nvidia Installer

Now, run the Nvidia installer and the DKMS module should build.

sudo sh NVIDIA-Linux-x86-310.32.run

Or whatever version you downloaded.

Problems Compiling the Ralink Wireless N Driver Make Error 2 Fix

Tuesday, January 22nd, 2013

Problems Compiling the Ralink Wireless N Driver

If you receive a make error 2 while compiling the ralink drivers, try this fix. This applies to newer kernel versions.

 

PeerGuardian Linux Ubuntu Prerequisites and Install Guide

Saturday, March 24th, 2012

PeerGuardian Installation Guide Ubuntu / Debian

Installing PeerGuardian:

Open a new terminal and install the prerequisites for PeerGuardian Linux but using the following commands:

sudo apt-get install libdbus-1-dev zlib1g-dev iptables libnetfilter-queue-dev libnfnetlink-dev qt4-bin-dbg qt4-dev-tools qt4-bin-dbg g++ libpolkit-qt-1-1 libpolkit-qt-1-dev

Download the latest source of PeerGuardian Linux from:  http://sourceforge.net/projects/peerguardian/files/PeerGuardian%20Linux/

Open a terminal, change to the peerguardian source directory, and run the configure file to generate the makefile.

./configure --sysconfdir=/etc

If you get an error stating that looks like this:

checking for ZLIB... configure: error: Package requirements (zlib) were not met:

No package 'zlib' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables ZLIB_CFLAGS
and ZLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

You'll need to download and compile the source of zlib from  http://www.zlib.net/

To do this, just change to the directory of the extracted zlib folder, run:

./configure
sudo make
sudo make install

Now, go back to the peerguardian source directory, and re-run ./configure

You will not receive this error anymore.  Why does this happen in the first place?  Installing zlib1g-dev should have been enough to satisfy this requirement, but for some reason it doesn't work sometimes and could be a bug.

Errors Post Installation:

BELOW ISSUE (BOTH Bricking your System and Resolv.conf Issue) APPEARS TO HAVE BEEN FIXED IN MAY of 2013
I'm going to leave this here though in case someone needs it.
 

As of 3/17/13, I've noticed that installing Peerguardian Linux from the latest SourceForge source causes a number of serious problems that could brick your Linux install. You must run the following commands after "make install" is completed to avoid running into problems.

If your gksudo or sudo commands no longer work after installing because of a "Unable to copy the user's .Xauthorization file" error message, your .Xauthority file may no longer exist.  To fix this issue, run the following commands:

gksudo synaptic
sudo chown youruser:youruser ~/.Xauthority
chmod 600 ~/.Xauthority

If the above does not work for you, try this:

cd ~
touch .Xauthority
sudo chown youruser:youruser ~/.Xauthority
chmod 600 ~/.Xauthority 

For some reason, the installer also changes the permissions on the tmp system folder.  To fix this, run the following command:

sudo chmod 1777 /tmp

Peerguardian Linux can also break your DNS settings rendering your internet connection useless.  To fix this issue, run the following commands:

sudo nano /etc/resolv.conf

In it, put your router's dns information in. For example:

nameserver 192.168.1.1

Save and close the file.  Everything should be good to go and your system is not hosed from a buggy compilation of Peerguardian Linux