Skip to content

Latest commit

 

History

History
151 lines (109 loc) · 5.18 KB

README.org

File metadata and controls

151 lines (109 loc) · 5.18 KB

About

The script can generate apt sources list for Ubuntu and Debian (7+ only). It is aware of code name to version number mappings and which releases are current or old. It can use the classic and deb822 formats. The latter is used by default since Ubuntu 24.04 / Debian 12.

Ubuntu or Debian mode is decided by the name the script was called as. ubuntu-sources itself works in Ubuntu mode. When called by the debian-sources symlink, it works in Debian mode.

The script requires bash 4.3+, hence you need at least Ubuntu 14.04 / Debian 8 to run it.

> ubuntu-sources --all jammy
# -- Generated by ubuntu-sources 24.06.xx+git

deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

# -- ubuntu-sources --all jammy
> ubuntu-sources --script 12.04
tee /etc/apt/sources.list >/dev/null <<'EOF'
# -- Generated by ubuntu-sources 24.06.xx+git

deb http://old-releases.ubuntu.com/ubuntu/ precise main
deb http://old-releases.ubuntu.com/ubuntu/ precise-updates main
deb http://old-releases.ubuntu.com/ubuntu/ precise-security main

# -- ubuntu-sources precise
EOF
> debian-sources --all 12
# -- Generated by debian-sources 24.06.xx+git

Types: deb
URIs: http://deb.debian.org/debian/
Suites: bookworm bookworm-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://security.debian.org/debian-security/
Suites: bookworm-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

# -- debian-sources --all bookworm

Usage

ubuntu-sources

ubuntu-sources [options] distro [region]

Distro can be either a name or a version number.

Region to mirror relation

CC country codehttp://CC.archive.ubuntu.com/ubuntu/
cdnmirror://mirrors.ubuntu.com/mirrors.txt
oldhttp://old-releases.ubuntu.com/ubuntu/

If region is not set, the mirror used is http://archive.ubuntu.com/ubuntu/. Old known releases are treated as such without explicit old region.

Generic options

-h, --help
Show usage
-q
Mute info messages. Use it twice (or -qq) to mute warnings as well
-V, --version
Show version

Options (defaults are star-marked)

--restricted --universe --multiverse --no-restricted* --no-universe* --no-multiverse*
Toggle the corresponding component
--all
Shortcut for --restricted --universe --multiverse
--security* --updates* --backports --proposed --no-security --no-updates --no-backports* --no-proposed*
Toggle the corresponding suite
--direct-security* --no-direct-security
Toggle use of security.ubuntu.com for the security suite. If disabled, generic mirrors are used instead. Only applicable to current releases
--src --no-src*
Toggle deb-src repo
--deb822** --no-deb822
Toggle deb822 format. On since Ubuntu 24.04
--script
Wrap the generated list into a script to write it to the default location

Examples

  • ubuntu-sources jammy
  • ubuntu-sources --universe --no-updates --src noble
  • ubuntu-sources --all --no-multiverse --backports 24.04 fr

debian-sources

debian-sources [options] distro [region]

Distro can be either a name or a version number.

Region to mirror relation

CC country codehttp://ftp.CC.debian.org/debian/
cdnhttp://deb.debian.org/debian/
oldhttp://archive.debian.org/debian/

If region is not set, the mirror used is http://deb.debian.org/debian/. Old known releases are treated as such without explicit old region.

Generic options

-h, --help
Show usage
-q
Mute info messages. Use it twice (or -qq) to mute warnings as well
-V, --version
Show version

Options (defaults are star-marked)

--contrib --non-free --non-free-firmware --no-contrib* --no-non-free* --no-non-free-firmware*
Toggle the corresponding component
--all
Shortcut for --contrib --non-free and --non-free-firmware, if applicable
--security* --updates* --backports --backports-sloppy --proposed-updates --no-security --no-updates --no-backports* --no-backports-sloppy* --no-proposed-updates*
Toggle the corresponding suite
--direct-security* --no-direct-security
Toggle use of security.debian.org for the security suite. If disabled, generic mirrors are used instead. Only applicable to current releases
--src --no-src*
Toggle deb-src repo
--deb822** --no-deb822
Toggle deb822 format. On since Debian 12
--script
Wrap the generated list into a script to write it to the default location

Examples

  • debian-sources bullseye
  • debian-sources --contrib --no-updates --src bookworm
  • debian-sources --all --no-non-free-firmware --backports 12 fr