Using packages from repositories other than Debian Stable can make your system unstable. However, there are cases where you need a package that isn’t yet available for your current Debian release, and taking this risk becomes necessary.
The configuration below shows how to pin a package, preventing it from being automatically upgraded to the unstable (sid)/experimental version while still allowing you to install the specific package you need.
Unstable Repositories
/etc/apt/sources.list.d/unstable.sources
Types: deb deb-src URIs: http://deb.debian.org/debian Suites: sid Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
/etc/apt/preferences.d/unstable
Package: * Pin: release a=unstable Pin-Priority: 100Package installation
$ apt-get install -t unstable linux-kernel-amd64
Experimental Repositories
/etc/apt/sources.list.d/experimental.sources
Types: deb deb-src URIs: http://deb.debian.org/debian Suites: experimental Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
/etc/apt/preferences.d/experimental
Package: * Pin: release a=experimental Pin-Priority: 1Package installation
$ apt-get install -t experimental nvidia-driver