Coder Social home page Coder Social logo

apt-source-list-template's Introduction

Template for apt source list

Warning Intended for debian-based ditributions only with use of Apt.

Source list

You have to rename the sources-<branch>.list to sources.list and put it in the /etc/apt/ folder.

For each kind of repository:

Stable branch or Testing branch

For the stable branch, there is a source-stable.list with several repositories. For the testing branch, there is also a source-testing.list with the same repositories:

  • Stable for standard update source
  • Stable-security for standard security update source
  • Stable-backports for more recent versions of some packages
  • Stable-proposed-updates for upcoming point releases packages
  • Stable-updates for package changes that cannot wait for the next point release

Warning There is some tiny problem with the stable repositories, the codenames doesn't match with the stable tag but with the current debian codename distribution.

For querying debian repository to see stable backport codename (only tagged for current codename, not stable):

$ curl -fsSL 'http://ftp.fr.debian.org/debian/dists/stable-backports/Release' | grep -E '^Suite|^Codename'
Suite: bullseye-backports
Codename: bullseye-backports
$ curl -fsSL 'http://ftp.fr.debian.org/debian/dists/stable-proposed-updates/Release' | grep -E '^Suite|^Codename'
Suite: proposed-updates
Codename: bullseye-proposed-updates

So when you will do apt update, you will get some warnings like this:

W: Conflicting distribution: http://ftp.fr.debian.org/debian stable-backports InRelease (expected stable-backports but got bullseye-backports)
W: Conflicting distribution: http://ftp.fr.debian.org/debian stable-proposed-updates InRelease (expected stable-proposed-updates but got 
bullseye-proposed-updates)

These warnings are harmless but quite annoying, to get rid of them juste replace the stable tag in stable-backports and stable-proposed-updates with your current codename distribution.

You can get it with lsb_release -sc or cat /etc/os-release | grep -P "(?<=VERSION_CODENAME=).*"

echo $(lsb_release -sc)-proposed-updates
echo $(lsb_release -sc)-backports

Custom source lists

There is also some custom source files in sources.list.d to have for example the spotify, vscode or kali-branch packages. They aren't default packages and relies on external repositories, so you have to add for each repository you want it's own gpg key.

The debian-archive-keyring package is used to distribute keys to apt. Upgrades to this package can add (or remove) gpg keys for the main Debian archive.

For other archives, there is not yet a standard location where you can find the key for a given apt repository.

There's a rough standard of putting the key up on the web page for the repository or as a file in the repository itself, but no real standard, so you might have to hunt for it.

You can also check on a public key server provider and try to found the desired key by repository name or key ID:

Be sure to verify the source and the veracity of the gpg key you want to add.

After finding this key you must know the kind of gpg key you are dealing with. Run file <repo-key>.gpg, if you get a similar to the following then the key is ascii-armored:

$ file <repo-key>.gpg
repo-key.gpg: PGP public key block Public-Key (old)

For armored key:

gpg --dearmor --export <repo-key>.gpg

For non armored key:

gpg --export <repo-key>.gpg

And finaly you have to put it in the /etc/apt/trusted.gpg.d folder in a file ending with .gpg.

Final command to download the gpg key and put it directly into a custom file (if gpg armored file):

curl <https://example.com/key/repo-key.gpg> | gpg --dearmor > /etc/apt/trusted.gpg.d/<repository_name>.gpg

or

wget -O- <https://example.com/key/repo-key.gpg> | gpg --dearmor > /etc/apt/trusted.gpg.d/<repository_name>.gpg

To list all gpg keys, type apt-key list

Preferences

The preferences.d folder contain preference files for several branch repositories.

In these files, there is priority assigned to each branch repository regarding to it's optionality or it's bleeding edge versioning,more a priority is high, more it will be used for dowloading and upgrading packages because apt always install the highest priority version.

If two or more versions have the same priority, apt will install the most recent one (that is, the one with the higher version number).

stable but not newest packages repositories have always the highest priority in my configuration.

So for the moment:

Installation of softwares

There is a bunch of usefull software to install depending on your needs.

For example you have a nvidia card and want the latest stable drivers according to a newer debian branch stable-backports:

apt install nvidia-driver
apt install -t stable-backports nvidia-cuda-dev
apt install -t stable-backports nvidia-cuda-toolkit

For statistics about perforances or network:

apt install htop iftop

For more recent linux kernel images:

apt install -t stable-backports linux-image-amd64
apt install -t stable-backports linux-headers-amd64

For more recent non open source binary firmwares (for various drivers):

apt install -t stable-backports firmware-misc-nonfree

Hold back a package version

https://manpages.ubuntu.com/manpages/bionic/man8/apt-mark.8.html

sudo apt-mark hold <package_name>

hold is used to mark a package as held back, which will prevent the package from being automatically installed, upgraded or removed.

apt-source-list-template's People

Contributors

moniika21 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.