Switch from sources.list to ubuntu.sources

Template is based on the specification with some rewording for
Ubuntu Pro as agreed.

v2:
- Enabled backports by default (I did not see that!)
- Enabled restricted, multiverse security updates
- Replaced tweaked with adjusted

v3:
- Insert an explanatory sources.list

LP: #2048129
ubuntu-core-desktop-noble
Julian Andres Klode 12 months ago
parent 9480b91abc
commit 8a0a5a7e4a

@ -101,15 +101,27 @@ use_lp_archives_in_sourceslist(){
# recover_sourceslist # recover_sourceslist
mountpoint="${1}" mountpoint="${1}"
MOUNTPOINT_BACKUP_SOURCES_LIST="sources.list.tmp"
. config/bootstrap # For the LB_MIRROR_* variables . config/bootstrap # For the LB_MIRROR_* variables
cp -a "${mountpoint}/etc/apt/sources.list" "${MOUNTPOINT_BACKUP_SOURCES_LIST}" if [ -e "${mountpoint}/etc/apt/sources.list.d/ubuntu.sources" ]; then
sed -i "s#http://archive.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \ MOUNTPOINT_BACKUP_UBUNTU_SOURCES="ubuntu.sources.tmp"
"${mountpoint}/etc/apt/sources.list" cp -a "${mountpoint}/etc/apt/sources.list.d/ubuntu.sources" "${MOUNTPOINT_BACKUP_UBUNTU_SOURCES}"
sed -i "s#http://security.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \ sed -i "s#http://archive.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
"${mountpoint}/etc/apt/sources.list" "${mountpoint}/etc/apt/sources.list.d/ubuntu.sources"
sed -i "s#http://security.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
sha256sum "${mountpoint}/etc/apt/sources.list" > sources.list.sha "${mountpoint}/etc/apt/sources.list.d/ubuntu.sources"
sha256sum "${mountpoint}/etc/apt/sources.list.d/ubuntu.sources" > ubuntu.sources.sha
fi
if [ -e "${mountpoint}/etc/apt/sources.list" ]; then
MOUNTPOINT_BACKUP_SOURCES_LIST="sources.list.tmp"
cp -a "${mountpoint}/etc/apt/sources.list" "${MOUNTPOINT_BACKUP_SOURCES_LIST}"
sed -i "s#http://archive.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
"${mountpoint}/etc/apt/sources.list"
sed -i "s#http://security.ubuntu.com/ubuntu#${LB_PARENT_MIRROR_CHROOT}#g" \
"${mountpoint}/etc/apt/sources.list"
sha256sum "${mountpoint}/etc/apt/sources.list" > sources.list.sha
fi
} }
recover_sourceslist(){ recover_sourceslist(){
@ -121,10 +133,18 @@ recover_sourceslist(){
# sources.list.sha # sources.list.sha
mountpoint="${1}" mountpoint="${1}"
sha256sum --check sources.list.sha if [ -e "${MOUNTPOINT_BACKUP_UBUNTU_SOURCES:-/doesnotexist}" ]; then
sha256sum --check ubuntu.sources.sha
mv "${MOUNTPOINT_BACKUP_UBUNTU_SOURCES}" "${mountpoint}/etc/apt/sources.list.d/ubuntu.sources"
unset MOUNTPOINT_BACKUP_UBUNTU_SOURCES
fi
if [ -e "${MOUNTPOINT_BACKUP_SOURCES_LIST:-/doesnotexist}" ]; then
sha256sum --check sources.list.sha
mv "${MOUNTPOINT_BACKUP_SOURCES_LIST}" "${mountpoint}/etc/apt/sources.list" mv "${MOUNTPOINT_BACKUP_SOURCES_LIST}" "${mountpoint}/etc/apt/sources.list"
unset MOUNTPOINT_BACKUP_SOURCES_LIST unset MOUNTPOINT_BACKUP_SOURCES_LIST
fi
} }
setup_mountpoint() { setup_mountpoint() {
@ -872,48 +892,58 @@ configure_universe() {
# debian-installer's apt-setup: # debian-installer's apt-setup:
cat > chroot/etc/apt/sources.list << EOF cat > chroot/etc/apt/sources.list << EOF
# Ubuntu sources have moved to the /etc/apt/sources.list.d/ubuntu.sources
# file, which uses the deb822 format. Use deb822-formatted .sources files
# to manage package sources in the /etc/apt/sources.list.d/ directory.
# See the sources.list(5) manual page for details.
EOF
cat > chroot/etc/apt/sources.list.d/ubuntu.sources << EOF
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution. # newer versions of the distribution.
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION main restricted ## Ubuntu distribution repository
##
## Major bug fix updates produced after the final release of the ## The following settings can be adjusted to configure which packages to use from Ubuntu.
## distribution. ## Mirror your choices (except for URIs and Suites) in the security section below to
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted ## ensure timely security updates.
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates main restricted ##
## Types: Append deb-src to enable the fetching of source package.
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## URIs: A URL to the repository (you may add multiple URLs)
## team. Also, please note that software in universe WILL NOT receive any ## Suites: The following additional suites can be configured
## review or updates from the Ubuntu security team. ## <name>-updates - Major bug fix updates produced after the final release of the
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe ## distribution.
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION universe ## <name>-backports - software from this repository may not have been tested as
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe ## extensively as that contained in the main release, although it includes
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates universe ## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## or updates from the Ubuntu security team.
## team, and may not be under a free licence. Please satisfy yourself as to ## Components: Aside from main, the following components can be added to the list
## your rights to use the software. Also, please note that software in ## restricted - Software that may not be under a free license, or protected by patents.
## multiverse WILL NOT receive any review or updates from the Ubuntu ## universe - Community maintained packages.
## security team. ## Software from this repository is only maintained and supported by Canonical
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse ## for machines with Ubuntu Pro subscriptions. Without Ubuntu Pro, the Ubuntu
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION multiverse ## community provides best-effort security maintenance.
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse ## multiverse - Community maintained of restricted. Software from this repository is
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-updates multiverse ## ENTIRELY UNSUPPORTED by the Ubuntu team, and may not be under a free
## licence. Please satisfy yourself as to your rights to use the software.
## N.B. software from this repository may not have been tested as ## Also, please note that software in multiverse WILL NOT receive any
## extensively as that contained in the main release, although it includes ## review or updates from the Ubuntu security team.
## newer versions of some applications which may provide useful features. ##
## Also, please note that software in backports WILL NOT receive any review ## See the sources.list(5) manual page for further settings.
## or updates from the Ubuntu security team. Types: deb
deb $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse URIs: $LB_PARENT_MIRROR_BINARY
# deb-src $LB_PARENT_MIRROR_BINARY $LB_DISTRIBUTION-backports main restricted universe multiverse Suites: $LB_DISTRIBUTION $LB_DISTRIBUTION-updates $LB_DISTRIBUTION-backports
Components: main universe restricted multiverse
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security main restricted
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe ## Ubuntu security updates. Aside from URIs and Suites,
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security universe ## this should mirror your choices in the previous section.
deb $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse Types: deb
# deb-src $LB_PARENT_MIRROR_BINARY_SECURITY $LB_DISTRIBUTION-security multiverse URIs: $LB_PARENT_MIRROR_BINARY_SECURITY
Suites: $LB_DISTRIBUTION-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
EOF EOF
fi fi

Loading…
Cancel
Save