How to add the myguard APT repository to Debian and Ubuntu

Two methods to add deb.myguard.nl to your server. Method 1 takes under a minute. Method 2 is for those who prefer full manual control.

Method 2 — Manual setup

Add the repository manually using your distribution codename. Uses the modern signed-by approach supported on all current Debian and Ubuntu releases.

apt-get install -y lsb-release wget gpg
CODENAME=$(lsb_release -c -s)
wget -qO- https://deb.myguard.nl/pool/myguard.gpg 
  | gpg --dearmor 
  | tee /usr/share/keyrings/myguard-archive-keyring.gpg >/dev/null
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/myguard-archive-keyring.gpg] https://deb.myguard.nl $CODENAME main" 
  > /etc/apt/sources.list.d/deb.myguard.nl.list
apt-get update

Supported distributions

  • Debian 12 (Bookworm), Debian 13 (Trixie)
  • Ubuntu 22.04 (Jammy), Ubuntu 24.04 (Noble), Ubuntu 26.04 (Resolute)

APT pinning (optional)

Pinning gives packages from this repository priority over the default distribution packages. Configured automatically by Method 1. For manual setups:

cat > /etc/apt/preferences.d/99debmyguard.nl <<'EOF'
Package: *
Pin: origin deb.myguard.nl
Pin-Priority: 501
EOF

Verify the GPG key

gpg --no-default-keyring 
  --keyring /usr/share/keyrings/myguard-archive-keyring.gpg 
  --fingerprint

What to install next

Troubleshooting

  • Wrong codename: run lsb_release -c -s to confirm your distro codename matches the supported list above
  • GPG errors: re-import the key using the gpg --dearmor command in Method 2
  • Package conflicts: enable pinning (see above) so myguard packages take priority over distribution defaults
  • arm64 / other architectures: replace arch=amd64 with arch=arm64 in the sources.list line if needed

Report problems at github.com/eilandert/deb.myguard.nl.

Related guides