Saturday, April 3, 2021

change can be good

I'm testing out the deb822-style format for control files used by apt, replacing the older one-line-style format used in the sources.list file. I couldn't find any "official" Debian documentation on this topic except for what's contained in man sources.list (see https://manpages.debian.org/buster/apt/sources.list.5.en.html).


I did find a couple of pages online that helped a bit:

"How to use the new DEB822 apt format on Ubuntu" - https://www.techrepublic.com/article/how-to-use-the-new-deb822-apt-format-on-ubuntu/

"Explanation of the DEB822 Source Format" - https://repolib.readthedocs.io/en/latest/deb822-format.html


I tested the new format in Debian Buster. Here are the lines I was using in the /etc/apt/sources.list file:

deb http://ftp.us.debian.org/debian/ buster main contrib non-free
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb http://ftp.us.debian.org/debian/ buster-updates main contrib non-free


I renamed the sources.list file with the following command:

$ sudo mv /etc/apt/sources.list /etc/apt/sources.list-bkup

Then I created the new file /etc/apt/sources.list.d/debian-sources:

$ sudo nano /etc/apt/sources.list.d/debian.sources


The contents of the debian-sources file:

Types: deb
URIs: http://ftp.us.debian.org/debian/
Suites: buster buster-updates
Components: main contrib non-free

Types: deb
URIs: http://security.debian.org/debian-security
Suites: buster/updates
Components: main contrib non-free


Finally, I ran the following to make sure everything worked correctly:

$ sudo apt update


Users can decide for themselves if they like the newer format or prefer to stick with the older one. I think the deb822 format makes it a bit easier to see, at a glance, how things are set up.

 

No comments: