Struggling with debmirror here

Trying to figure out how to change the deb mirror source. Here is the script itself;

#!/bin/bash

NOTES:

Trailing Slash is Required on the server=line

i.e. server=mirror.pit.teraswitch.com/

Leading and Training Slash is Required on the --root parameter

i.e. --root=‘/ubuntu-advantage/security-benchmarks/ubuntu/’

script_name=$(basename – “$0”)
if pidof -x “$script_name” -o $$ >/dev/null; then
echo “An another instance of this script is already running, please clear all the sessions of this script before starting a new session”
exit 1
fi

export GNUPGHOME=/root/ubuntukeyring
arch=amd64
inPath=/ubuntu

Ubunuta Advantage

#deb Index of /fips-updates/ubuntu/ bionic-updates main
#deb Index of /fips-updates/ubuntu/ jammy-updates main

Working

outPath=/var/www/html/latest/deb/esm/fips-updates/ubuntu

server=esm.ubuntu.com/

release=“bionic-updates,jammy-updates”
section=main
proto=https
repolog=“/var/log/debmirror/${server::-1}.log”

/usr/local/bin/debmirror -a $arch -s $section -h $server --dist=$release --method=$proto
–rsync-extra=none
–root=/fips-updates/ubuntu/
–user=bearer
–passwd='redacted’>
$outPath -v 2>&1 | tee -a $repolog

Now, the problem is that the path seems to have changed for esm.ubuntu.com to this;

esm.ubuntu.com/fips-updates/ubuntu/dists/bionic-updates/ but the debmirror script isnt picking it up. I have both bionic and focal on the farm so I can’t specify both or either. Any ideas? here are the errors;

gpgv: Good signature from “Ubuntu Federal Information Processing Standards Automatic Signing Key V1 [email protected]
[ 0%] Getting: dists/jammy/main/binary-amd64/Packages.gz… Download of dists/jammy/main/binary-amd64/Packages.gz failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/binary-amd64/Packages… Download of dists/jammy/main/binary-amd64/Packages failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/binary-amd64/Release… Download of dists/jammy/main/binary-amd64/Release failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/source/Sources.gz… Download of dists/jammy/main/source/Sources.gz failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/source/Sources… Download of dists/jammy/main/source/Sources failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/source/Release… Download of dists/jammy/main/source/Release failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/binary-amd64/Packages.gz… Download of dists/jammy/main/binary-amd64/Packages.gz failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/binary-amd64/Packages… Download of dists/jammy/main/binary-amd64/Packages failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/binary-amd64/Release… Download of dists/jammy/main/binary-amd64/Release failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/source/Sources.gz… Download of dists/jammy/main/source/Sources.gz failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/source/Sources… Download of dists/jammy/main/source/Sources failed: 404 Not Found
[ 0%] Getting: dists/jammy/main/source/Release… Download of dists/jammy/main/source/Release failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-i386/Packages.gz… Download of dists/bionic/main/binary-i386/Packages.gz failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-i386/Packages… Download of dists/bionic/main/binary-i386/Packages failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-i386/Release… Download of dists/bionic/main/binary-i386/Release failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-amd64/Packages.gz… Download of dists/bionic/main/binary-amd64/Packages.gz failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-amd64/Packages… Download of dists/bionic/main/binary-amd64/Packages failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-amd64/Release… Download of dists/bionic/main/binary-amd64/Release failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/source/Sources.gz… Download of dists/bionic/main/source/Sources.gz failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/source/Sources… Download of dists/bionic/main/source/Sources failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/source/Release… Download of dists/bionic/main/source/Release failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-i386/Packages.gz… Download of dists/bionic/main/binary-i386/Packages.gz failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-i386/Packages… Download of dists/bionic/main/binary-i386/Packages failed: 404 Not Found
[ 0%] Getting: dists/bionic/main/binary-i386/Release… Download of dists/bionic/main/binary-i386/Release failed: 404 Not Found

Download of dists/jammy/main/binary-amd64/Packages.gz failed: 404 Not Found
dists/jammy/main/binary-amd64/Packages.gz failed checksum verification
Download of dists/jammy/main/binary-amd64/Packages failed: 404 Not Found
dists/jammy/main/binary-amd64/Packages failed checksum verification
Download of dists/jammy/main/binary-amd64/Release failed: 404 Not Found
dists/jammy/main/binary-amd64/Release failed checksum verification, removing
Download of dists/jammy/main/source/Sources.gz failed: 404 Not Found
dists/jammy/main/source/Sources.gz failed checksum verification
Download of dists/jammy/main/source/Sources failed: 404 Not Found
dists/jammy/main/source/Sources failed checksum verification
Download of dists/jammy/main/source/Release failed: 404 Not Found
dists/jammy/main/source/Release failed checksum verification, removing
Download of dists/jammy/main/binary-amd64/Packages.gz failed: 404 Not Found
dists/jammy/main/binary-amd64/Packages.gz failed checksum verification
Download of dists/jammy/main/binary-amd64/Packages failed: 404 Not Found
dists/jammy/main/binary-amd64/Packages failed checksum verification
Download of dists/jammy/main/binary-amd64/Release failed: 404 Not Found
dists/jammy/main/binary-amd64/Release failed checksum verification, removing
Download of dists/jammy/main/source/Sources.gz failed: 404 Not Found
dists/jammy/main/source/Sources.gz failed checksum verification
Download of dists/jammy/main/source/Sources failed: 404 Not Found
dists/jammy/main/source/Sources failed checksum verification
Download of dists/jammy/main/source/Release failed: 404 Not Found
dists/jammy/main/source/Release failed checksum verification, removing
Download of dists/bionic/main/binary-i386/Packages.gz failed: 404 Not Found
dists/bionic/main/binary-i386/Packages.gz failed checksum verification
Download of dists/bionic/main/binary-i386/Packages failed: 404 Not Found
dists/bionic/main/binary-i386/Packages failed checksum verification
Download of dists/bionic/main/binary-i386/Release failed: 404 Not Found
dists/bionic/main/binary-i386/Release failed checksum verification, removing
Download of dists/bionic/main/binary-amd64/Packages.gz failed: 404 Not Found
dists/bionic/main/binary-amd64/Packages.gz failed checksum verification
Download of dists/bionic/main/binary-amd64/Packages failed: 404 Not Found
dists/bionic/main/binary-amd64/Packages failed checksum verification

this is not about a debian mirror, you are using ubuntu. According to debian, use deb.debian.org and it will find the closest mirror.
My debian 13 updates fine, cat /etc/apt/sources.list

deb http://deb.debian.org/debian/ trixie main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie main non-free-firmware

deb http://security.debian.org/debian-security trixie-security main non-free-firmware
deb-src http://security.debian.org/debian-security trixie-security main non-free-firmware

# trixie-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ trixie-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ trixie-updates main non-free-firmware
2 Likes

Right, its not about debian mirrior, its about debmirror. But esm.ubuntu.com seems to have changed its path or how the debmirror script navigates the path.

Did you follow this guide? I’m not going to do it but there is no “esm” in this guide.
https://help.ubuntu.com/community/Debmirror

ESM Apps (Expanded Security Maintenance) the designation used by Canonical for the packages in the universe repository that gets 10 years of security updates with an Ubuntu Pro subscription. Ubuntu Expanded Security Maintenance | Security | Ubuntu

1 Like

We have an existing debmirror in place and the last few days its stopped working. I followed the paths and noticed some name changes from esm.ubuntu.com but can’t seem to find out how to change debmirror.sh to pull from the new directory. Its still attemping to pull the incorrect binaries for dists/bionic instead of dists/bionic-updates

can you post the script as [code] … [/code] since it is difficult to read. Redact as necessary.

1 Like
arch=amd64
section=main
server=esm.ubuntu.com/
release=bionic-updates
proto=https
outPath=var/www/html/latest/deb/esm/fips-updates/ubuntu
repolog="/var/log/debmirror/${server::-1}.log"

/usr/local/bin/debmirror -a $arch -s $section -h $server --dist=$release \
    --method=$proto –rsync-extra=none –root=/fips-updates/ubuntu/        \    
    --user=bearer --passwd='redacted’>                                   \
    $outPath -v 2>&1 | tee -a $repolog

I dont have an account to test.

1 Like

esm.ubuntu.com works fine.. its just not pulling the right dist I’m trying to force it to pull a different dist

It keeps trying to pull bionic instead of bionic-updates as well as jammy instead of jammy-updates hence the 404 not found.

I dont know how you can contact someone at who manages esm.ubuntu.com.

the dir structure is missing dirs for fips, fips-updates, etc.

1 Like

read this link, How to mirror ubuntu ESM protected repository · GitHub your machine has ubuntu pro, there is a file, cat /etc/apt/auth.conf.d/90ubuntu-advantage which gives you login and pw. Sample bash script:

#!/bin/bash
# Local directory for the mirror
export MIRROR_DIR="/var/www/html/ubuntu-esm"

# ESM Credentials (retrieved from /etc/apt/auth.conf.d/)
export ESM_USER="bearer"
export ESM_PASS="<YOUR_BEARER_TOKEN>"

# Run debmirror
debmirror \
  --method=https \
  --host="${ESM_USER}:${ESM_PASS}@esm.ubuntu.com" \
  --root="infra" \
  --dist=bionic-infra-security,bionic-infra-updates \
  --section=main \
  --arch=amd64 \
  --no-source \
  --cleanup \
  --progress \
  --ignore-release-gpg \
  "$MIRROR_DIR"
3 Likes