Fixes and updates.

This commit is contained in:
cyteen 2026-03-06 00:16:59 +00:00
parent 8ca363fd75
commit 1310e854bb
1 changed files with 73 additions and 36 deletions

View File

@ -1,17 +1,54 @@
#!/usr/bin/env bash
# avoid duplicates
set -x
set -euo pipefail
rm /etc/apt/sources.list
rm /etc/apt/sources.list.d/devuan.list
sudo apt install -y apt-transport-tor apt-transport-https
# If you leave the update too long the keyring expires and your apt breaks.
install_devuan_keyring() {
local BASE_URL="https://pkgmaster.devuan.org/devuan/pool/main/d/devuan-keyring/"
local DEB_DIR="/tmp"
# https://www.devuan.org/os/packages
# FIXME: the mirror is now permenently on deb but:
# http://deb.devuan.org/merged
# is used for main, update, backports and security
# http://deb.devuan.org/devuan
# is used for experimental, proposed-updates
# Check for wget dependency
if ! command -v wget &>/dev/null; then
echo "Error: wget is not installed." >&2
return 1
fi
echo "Searching for the latest devuan-keyring..."
# Fetch directory listing, extract .deb links, filter, sort by version, take latest
local LATEST_DEB
LATEST_DEB=$(wget -q -O - "$BASE_URL" |
grep -oP 'devuan-keyring_\d{4}\.\d{2}\.\d{2}_all\.deb' |
sort -rV |
head -n 1)
if [ -z "$LATEST_DEB" ]; then
echo "Error: Could not find any devuan-keyring_*.deb in listing" >&2
return 1
fi
echo "Latest found: $LATEST_DEB"
local FULL_URL="${BASE_URL}${LATEST_DEB}"
local DEB_PATH="${DEB_DIR}/${LATEST_DEB}"
echo "Downloading to $DEB_PATH..."
wget -q --show-progress -O "$DEB_PATH" "$FULL_URL"
echo "Installing package..."
sudo dpkg -i "$DEB_PATH"
# Clean up the downloaded file
rm "$DEB_PATH"
echo "Installation complete and cleanup finished."
}
install_devuan_keyring
sudo apt install -y usrmerge
sudo apt install -y apt-transport-tor apt-transport-https
TRANSPORT="https"
#MIRROR=deb
@ -54,21 +91,21 @@ PROPOSED_LIST=('excalibur-proposed-updates')
# Active (enabled) loop all merged in your current choice
for RELEASE in "${ACTIVE_LIST[@]}"; do
echo "${RELEASE}"
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
Enabled: yes
Types: deb deb-src
URIs: ${MERGED_URI}
Suites: ${RELEASE}
Components: ${SECTION_MERGED}
Architectures: amd64
EOF
EOF
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
done
# Special / other (experimental, and potentially *-proposed-updates later)
for RELEASE in "${OTHER_LIST[@]}"; do
echo "${RELEASE}"
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
Enabled: yes
Types: deb deb-src
URIs: ${DEVUAN_URI}
@ -76,20 +113,20 @@ for RELEASE in "${OTHER_LIST[@]}"; do
Components: ${SECTION_SPECIAL}
Architectures: amd64
# Signed-By: /usr/share/keyrings/devuan-archive-keyring.gpg # optional, if needed
EOF
EOF
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
done
echo ${#OTHER_LIST[@]}
for RELEASE in "${OTHER_LIST[@]}"; do
echo "${RELEASE}"
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
Enabled: yes
Types: deb deb-src
URIs: ${TRANSPORT}://${MIRROR}.devuan.org/devuan
Suites: ${RELEASE}
Components: main
Architectures: amd64
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
Enabled: yes
Types: deb deb-src
URIs: ${TRANSPORT}://${MIRROR}.devuan.org/devuan
Suites: ${RELEASE}
Components: main
Architectures: amd64
EOF
done
@ -99,15 +136,15 @@ done
echo ${#PROPOSED_LIST[@]}
for RELEASE in "${PROPOSED_LIST[@]}"; do
echo "${RELEASE}"
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<-EOF
Enabled: no
Types: deb deb-src
URIs: ${DEVUAN_URI}
Suites: ${RELEASE}
Components: ${SECTION_SPECIAL}
Architectures: amd64
# Note: proposed-updates for upcoming point releases; not for production
EOF
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}.sources" <<EOF
Enabled: no
Types: deb deb-src
URIs: ${DEVUAN_URI}
Suites: ${RELEASE}
Components: ${SECTION_SPECIAL}
Architectures: amd64
# Note: proposed-updates for upcoming point releases; not for production
EOF
# Optional symlink even if disabled
ln -sf "${AVAILABLE}/devuan_${RELEASE}.sources" "${ACTIVE}/devuan_${RELEASE}.sources"
done
@ -140,15 +177,15 @@ for RELEASE in "${ONION_LIST[@]}"; do
SECTION_USED="${SECTION_MERGED}" # assume you defined SECTION_MERGED earlier as "main contrib non-free non-free-firmware"
fi
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}-onion.sources" <<-EOF
Enabled: no # change to yes if you run tor and want default onion
Types: deb deb-src
URIs: ${TOR_URI}
Suites: ${RELEASE}
Components: ${SECTION_USED}
Architectures: amd64
# Tor / onion routing - requires apt-transport-tor installed and tor running
EOF
bash -c "cat > ${AVAILABLE}/devuan_${RELEASE}-onion.sources" <<EOF
Enabled: no
Types: deb deb-src
URIs: ${TOR_URI}
Suites: ${RELEASE}
Components: ${SECTION_USED}
Architectures: amd64
# Tor / onion routing - requires apt-transport-tor installed and tor running
EOF
ln -sf "${AVAILABLE}/devuan_${RELEASE}-onion.sources" "${ACTIVE}/devuan_${RELEASE}-onion.sources"
done