Installing NVIDIA Drivers On Debian Lenny Manually

Want to support HowtoForge? Become a subscriber!
 
Submitted by koosha (Contact Author) (Forums) on Fri, 2009-09-25 14:41. :: Debian

Installing NVIDIA Drivers On Debian Lenny Manually

Introduction

Installing NVIDIA drivers on Debian Lenny requires a little extra work compared to doing so in other distributions like Ubuntu, due to the lack of some required packages in the default installation.

 

Getting NVIDIA Driver

Go to the NVIDIA official web site. Navigate to the drivers section. Choose the latest appropriate driver depending on your Linux platform (32- or 64-bit) and your graphic card model. Download the driver to your /home/username directory (or any other place of your choice).

 

Installing the Required Packages

The packages which are required for installing NVIDIA drivers and are not included in Debian Lenny by default are make, gcc and linux-headers-xxx. In order to install these packages, insert the first Debian installation DVD into your optical drive, open the Terminal and run the following command as root:

# apt-get install make gcc gcc-4.1 linux-headers* -y

Note: It is assumed that you have the Debian DVD 1 as one of your software repositories, the case which is satisfied by default.

Debian kernel was compiled with gcc version 4.1. When you try to install NVIDIA driver with the other versions of gcc than 4.1, that will prevent you from installation, that's why we've installed gcc-4.1.

 

Installing NVIDIA Driver

Now everything's ready to install the driver. Open the Terminal and run the following command as root to stop the gdm:

# /etc/init.d/gdm stop

You will leave the graphical environment. With logged in as root, change the current working directory to the one you've just stored the driver into:

# cd /home/username/

if you have stored the driver there. If not, cd to the other directory.

You have to ask the BASH to use the gcc version 4.1; set the CC environmental variable to use gcc-4.1:

# export CC=/usr/bin/gcc-4.1

Now install the driver:

# sh NVIDIA-Linux-xxxxxxx-pkgx.run

Restart the gdm to log in and re-enter the graphical environment.

# gdm

You may now install compiz and enjoy its nice effects.


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by dmvazquez (registered user) on Thu, 2010-04-29 00:17.
It worked like a charm in my Debian Lenny 5.0.4 Trying to install driver, it asked for a missing 'make' tool. I pointed to: # apt-get install make Then I tried again install driver. OK! Perfect! Hope this little comment help another readers. Thank you for this helpful guide.
Submitted by Alberto E. Ant... (not registered) on Mon, 2010-01-25 03:31.

I have been through this procedure before with no result (and some others also). When re-started, system goes to console logging  screen and shows an error message about x server not properly configured with a line that states "Module does not exists". In other words, the installation  fails. The only difference is that I did not export CC=/usr/bin/gcc-4.1 but export CC=gcc-4.1 and I wonder if this could be the cause of driver faulty installation.

When I tried to install the driver using module assistant (which is highly recommended in several forums), at the ends it states "error inserting nvidia (/lib/modules/2.6.26-1-amd64/nvidia/nvidia.ko)  - something I have no idea about - And back to console screen again.

Taken from lspci:

nVidia Corporation NV17 [GeForce4 MX 440] (rev a3)

uname -r :   2.6.26-1-amd64

This is not a new video card, in fact it has been around for quite a few years and as far as I know, there should be not much of a trouble when installing drivers.

I am sorry if this causes any inconvenience or makes you waste your time, but in any case I would highly appreciate any help.

I hope you can get a trick out of the magicias's hat  or the magic wand.

Have a very happy new year.

Alberto E. Antúnez V.

Caracas - Venezuela

Submitted by danny0085 (not registered) on Sat, 2010-03-27 01:17.
Download and install NVIDIA drivers here the tutorial http://tips-linux.net/en/content/nvidia-driver-32-bits-part-1
Submitted by Grant (not registered) on Mon, 2009-09-28 22:50.

The way I prefer to make sure I have all of the dependencies is to use module-assistant.

apt-get install module-assistant

module-assistant

 Choose "Prepare" and it will grab exactly what you need to build kernel modules, which is what we are doing.

Submitted by Sebastian (not registered) on Sun, 2009-09-27 09:49.

Hi,

if you don't need the latest and greatest Driver (e.g. if you have an old nvidia card like me) you could also add a non-free mirror (try adding non-free in /etc/apt/sources.list, you will also need contrib) and install the nvidia-kernel module matching your debian kernel (see packages.debian.org). This should pull in nvidia-kernel-common. You also need nvidia-glx, which is the graphics driver itself.

If your Kernel is not in the list, you need nvidia-kernel-source and m-a. Then you can type

m-a a-i nvidia-kernel

to compile the kernel module using module-assistant. It installs the kernel-headers, if you have a debian-kernel automatically. Then you will also need nvidia-glx and nvidia-kernel-common.

If you have an older card which is not supported by the (in lenny) v173 driver, take a look at (in lenny) nvidia-glx-legacy-96xx. In sid the v173 is now legacy too, as there is the v185-driver present.

Personally I prefer installing or building (maybe with a little help from m-a ) debian packages, as they have dependency-management and could be easily removed. Sure, if you want to be always up-to date and there is no debian package, you have to go with manual installation, but in my opinion, this has always to be the last resort.

Kind regards

Sebastian

Submitted by BobRobertson (not registered) on Mon, 2009-09-28 22:05.
Module-assistant, the "m-a" above, is an excellent tool if the module has been packaged in the Debian repositories.

Also, you don't have to worry about which kernel headers to get if you use module-assistant, every time it's run it makes sure that the correct headers, kernel-build package, etc, are available for the presently running kernel on the system.

This is good if you use the backports kernels, or sid, which won't always have the nvidia modules precompiled.

Submitted by koosha (registered user) on Mon, 2009-09-28 10:31.
This method is useful when you do not have an internet connection but you have downloaded the driver already.
Submitted by R S Chakravarti (not registered) on Sun, 2009-09-27 07:17.

In my last comments, I should have added that you may have to use the Debian Sid packages

if they are the only ones available. 

Submitted by R S Chakravarti (not registered) on Sun, 2009-09-27 07:10.

As far as I know, the Debian non-free section has NVidia drivers.

If you have a custom kernel, you can compile the nvidia-kernel-source package.

(For older video cards 96xx and 71xx, choose the correct packages nvidia-glx-legacy-*

and kernel-legacy-source-*.) 

If we download the package from NVidia, can we make a deb out of it and install using dpkg?

Please explain. Thanks. 

Submitted by koosha (registered user) on Sun, 2009-09-27 12:09.

I do not think that it would be reasonable. What is the purpose of doing so?

A run file is actually a shell script, whereas a deb package is a collection of files.

Submitted by koosha (registered user) on Sun, 2009-09-27 12:07.

I do not think that it would be reasonable. What is the purpose of doing so?

A run file is actually a shell script, whereas a deb package is a collection of files.

Submitted by Anoop (not registered) on Tue, 2009-09-29 07:42.
users without access to the net will need the deb package where one with net access only need the script
Submitted by KhensU (not registered) on Tue, 2009-09-29 07:37.

Actually, that is how the debian packages are built. The .run file is run in extract-only mode and then the files are copied to appropriate places along with the packaging files. There's a bit more to it but that is the basic idea.

 

Randall Donald

Lead Developer of the Debian NVIDIA packaging team.

Submitted by R S Chakravarti (not registered) on Fri, 2009-10-09 17:51.

Since you lead the Nvidia Debian team,

would you please give the details, so that we can make debs from the latest Nvidia packages and avoid problems like files being overwritten when we install Nvidia drivers?