[HOWTO] DEB822-style repository sources

Share your own howto's etc. Not for support questions!

[HOWTO] DEB822-style repository sources

Postby Head_on_a_Stick » 2018-08-26 14:17

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!
I suffer from depression and may lash out occasionally, try not to take it personally.
User avatar
Head_on_a_Stick
 
Posts: 8170
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: [HOWTO] DEB822-style repository sources

Postby Head_on_a_Stick » 2018-08-26 17:12

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
I suffer from depression and may lash out occasionally, try not to take it personally.
User avatar
Head_on_a_Stick
 
Posts: 8170
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: [HOWTO] DEB822-style repository sources

Postby None1975 » 2018-08-27 13:54

As I understand it, ordinary users will not benefit from this? Only developers?
OS: Debian 9.5 / WM: Xmonad
Debian Wiki | DontBreakDebian, My config files in github
Linux User #607425
User avatar
None1975
 
Posts: 669
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable