Installing NVIDIA Drivers On Debian Lenny Manually


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

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

# gdm

You may now install compiz and enjoy its nice effects.

Share this page:

Suggested articles

15 Comment(s)

Add comment


By: Sebastian


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 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



This method is useful when you do not have an internet connection but you have downloaded the driver already.

By: BobRobertson

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.


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.

By: KhensU

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.

By: R S Chakravarti

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?

By: Anoop

users without access to the net will need the deb package where one with net access only need the script


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.

By: R S Chakravarti

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. 

By: R S Chakravarti

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. 

By: Grant

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

apt-get install module-assistant


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

By: Alberto E. Antúnez V.

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

By: danny0085

Download and install NVIDIA drivers here the tutorial


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.

By: Jens Tirsvad Nielsen

This script will install nvidia driver with or without secure boot (UEFI)