DEV Community

Jallow_加林
Jallow_加林

Posted on

How to Fix Ubuntu Repository Mirror Errors

The Problem
When you run sudo apt update, you might see an error message like this:

Screenshot showing ubuntu repository mirror errors

This means your Ubuntu system is trying to download packages from a mirror server (in this case, the German mirror de.archive.ubuntu.com) that is temporarily unavailable or slow.

Why This Happens
Ubuntu uses regional mirror servers to deliver software packages quickly to users in different parts of the world. When your region's mirror experiences problems, your system can't update. By switching to the official global mirror, you ensure reliable updates.

Step-by-Step Solution

Step 1: Open the Sources Configuration File
Open your terminal and type:

sudo nano /etc/apt/sources.list.d/ubuntu.sources
Enter fullscreen mode Exit fullscreen mode

Step 2: Find and Replace the Mirror Address

Inside the editor:

  • Press Ctrl+H (this opens the Find and Replace dialog)
  • In the "Search:" field, type: de.archive.ubuntu.com
  • Press Enter
  • In the "Replace with:" field, type: archive.ubuntu.com
  • Press A to replace all occurrences

Step 3: Save Your Changes

  • Press Ctrl+X
  • Press Y (confirm you want to save)
  • Press Enter (confirm the filename)

Step 4: Test the Fix

sudo apt update
Enter fullscreen mode Exit fullscreen mode

Success looks like this:

Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:3 https://cloud.r-project.org/bin/linux/ubuntu noble-cran40/ InRelease
[... more lines ...]
Reading package lists... Done
All packages are up to date.

Enter fullscreen mode Exit fullscreen mode

Image showing succesful mirror errors fixed

No errors or warnings! Your system is now fixed.

Step 5 (Optional): Update All Packages

To ensure your entire system is up to date, run:

sudo apt upgrade

Enter fullscreen mode Exit fullscreen mode

Top comments (0)