Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[HOWTO] DEB822-style repository sources

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

[HOWTO] DEB822-style repository sources

#1 Post by Head_on_a_Stick »

Most readers will be familiar with the so-called "one-line-style" format for storing information about the available repositories in a Debian system, the Wiki page lists some common examples of this format:

https://wiki.debian.org/SourcesList

However, there is another way: deb822(5).

This is explained further in sources.list(5):
sources.list(5) wrote:This is a new format supported by apt itself since version 1.1. Previous versions ignore such files with a notice message as described earlier. It is intended to make this format gradually the default format, deprecating the previously described one-line-style format, as it is easier to create, extend and modify for humans and machines alike especially if a lot of sources and/or options are involved. Developers who are working with and/or parsing apt sources are highly encouraged to add support for this format and to contact the APT team to coordinate and share this work. Users can freely adopt this format already, but may encounter problems with software not supporting the format yet.
Anyway, enough of the waffle, first remove the original sources:

Code: Select all

# mv /etc/apt/sources.list{,.bak}
Then create a new debian.sources file in the /etc/apt/sources.list.d/ subdirectory:

Code: Select all

# tee /etc/apt/sources.list.d/debian.sources <<!
Types: deb
URIs: https://cdn-aws.deb.debian.org/debian
Suites: stretch stretch-updates
Components: main

Types: deb
URIs: https://cdn-aws.deb.debian.org/debian-security
Suites: stretch/updates
Components: main
!
^ The lines between the exclamation marks are the actual content.

Now update and check the sources:

Code: Select all

root@hegel:~ # apt update
Ign:1 https://cdn-aws.deb.debian.org/debian stretch InRelease
Get:2 https://cdn-aws.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Hit:3 https://cdn-aws.deb.debian.org/debian-security stretch/updates InRelease
Hit:4 https://cdn-aws.deb.debian.org/debian stretch Release
Fetched 91.0 kB in 1s (64.6 kB/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@hegel:~ # apt policy                                                                        
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 https://cdn-aws.deb.debian.org/debian-security stretch/updates/main amd64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
     origin cdn-aws.deb.debian.org
 500 https://cdn-aws.deb.debian.org/debian stretch-updates/main amd64 Packages
     release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
     origin cdn-aws.deb.debian.org
 500 https://cdn-aws.deb.debian.org/debian stretch/main amd64 Packages
     release v=9.5,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
     origin cdn-aws.deb.debian.org
Pinned packages:
root@hegel:~ #
Done!
deadbang

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: [HOWTO] DEB822-style repository sources

#2 Post by Head_on_a_Stick »

Here's an example of how to transfer a third-party repository to the new format...

This is the original single line for the upstream Dungeon Crawl (Stone Soup edition) repositories:

Code: Select all

deb https://crawl.develz.org/debian crawl 0.22
For DEB822-style, this translates to:

Code: Select all

Types: deb
URIs: https://crawl.develz.org/debian
Suites: crawl
Components: 0.22
deadbang

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1389
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 45 times
Been thanked: 66 times

Re: [HOWTO] DEB822-style repository sources

#3 Post by None1975 »

As I understand it, ordinary users will not benefit from this? Only developers?
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

Post Reply