Debian Repositories

cat /etc/apt/sources.list is the old way to list repositories. It usually holds today the official repositories to be used. Adding additional repositories is not advised since the file could become messy.

ls /etc/apt/sources.list.d/ is the directory to hold repositories in a modern, clean and modular way. Every repository has its *.list file.

All repositories in /etc/apt/sources.list and /etc/apt/sources.list.d/ are considered.

Add additional repositories

In Debian many packages are very old or do not exist. A way out is adding additional repositories.

/etc/apt/sources.list.d/ is the directory to hold additional repositories as *.list file.

As cat /etc/apt/sources.list.d/docker.list shows

deb [arch=arm64 signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian   bookworm stable

As seen above, repositories need to have a keyring.

If not already exist, create a place for the key-rings sudo -p /etc/atp/keyrings

Then download the public pnp key (assuming the curl and ca-certificate packages are already installed) sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc

Having the key, the repository can be added as to /etc/apt/sources.list.d/ as *.list file containing the output of the echo command:

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

This command finds out the architecture used dpkg --print-architecture and Debian version echo $(. /etc/os-release && echo "$VERSION_CODENAME")

> /dev/null hides the normal output but would show errors

What the link will find can be opened in a web browser https://download.docker.com/linux/debian/dists/bookworm/stable/binary-arm64/

sudo apt update makes it aware that there is a new repository

sudo apt install <package> installs a package from the newly added repository

Debian system integrity checks

sudo dpkg --audit and sudo dpkg -C should not return errors and warnings

If sudo dpkg --audit clams, create a file with the list of packages and then sudo xargs -a <list of packages>.txt apt-get install --reinstall

sudo apt-get update and sudo apt-get install --reinstall $(dpkg -l | awk '/^ii/ {print $2}') will reinstall everything

sudo apt-get install debsums and sudo debsums -s will check the system files

sudo apt-get check

sudo touch /forcefsck and sudo reboot to test the disk or unplug the SDcard and do sudo fsck -f /dev/sd<x>

dmesg | less and journalctl -p err -b


Linurs startpage