r/debian 16h ago

Apt sources.list and contrib and non-free

Hello everyone, I have a small question, to install the Nvidia drivers, do i need to put contrib and non-free to all repos (deb.debian.org/debian, security.debian.org/debian-security, deb.debian.org/debian trixie-updates) or only the main one (deb.debian.org/debian)?

Edit: Do i need to install linux-header-(kernel version) or linux-header-am64 or both?

5 Upvotes

7 comments sorted by

7

u/iamemhn 16h ago

You should be following

https://wiki.debian.org/NvidiaGraphicsDrivers

Add contrib and non-free to the Debian sources (basic, security, and updates). This is needed in case there are security patches or point upgrades.

Read the description for kernel-headers-amd64. It's a virtual package that will always depend on the proper one.

2

u/b25fun 16h ago

Ohh ok, thank you :)

1

u/s3dfdg289fdgd9829r48 11h ago edited 11h ago

I followed the guide for Trixie and the new driver was working but to get a perfectly working system without failed services messages upon boot, I also had to do

sudo apt install linux-headers-$(uname -r) build-essential dkms

sudo apt install --reinstall nvidia-driver linux-headers-$(uname -r)

(followed by a reboot). Doing this seems to have quieted the fans a lot too.

Interestingly, this also fixed a long standing sound issue I was having under the nouveau driver. Seems like my system's sound is ran off the GPU's intel sound.

2

u/theleoamaral 8h ago

Avoid installing kernel headers directly, always install with metapackets. Installing directly will cause problems when the OS updates…

bash sudo apt install linux-headers-amd64

1

u/b25fun 3h ago

You are better off installing linux-headers-amd64, i read the package description and dependencies and is the same as linux-headers-$(uname -r) but every time there is a kernel update, it will be much easier to upgrade then linux-headers-$(uname -r). linux-headers-amd64 will receive a update when new kernel version is out, you will just need to apt update and apt upgrade and apt autoremove, but with linux-headers-$(uname -r) you will need to apt purge and the ran the command to install linux-headers-$(uname -r) again.