How to fix E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025· 574 views

This error occurs when apt-get cannot download packages from your configured repositories due to network issues, outdated package lists, or missing/broken packages. It typically indicates that some packages failed to fetch during installation and you need to retry or fix broken dependencies.

Quick fix

Fixes E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

sudo apt-get update
  1. Run apt-get update to refresh package lists
  2. Use --fix-missing flag to skip failed packages
  3. Clean and retry
  4. Fix broken packages with install -f
apt — error
sudo apt-get update
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

What this error means

The "Unable to fetch some archives" error in apt means that the package manager encountered one or more packages it couldn't download from the configured software repositories. This can happen for several reasons: - Your local package list is out of sync with the repository (missing or broken package references) - Network connectivity issues preventing downloads from repository mirrors - Repository URLs are incorrect, outdated, or the servers are temporarily unavailable - Previous installation attempts were interrupted, leaving your package system in a partially broken state - The package you're trying to install has unmet dependencies that cannot be fetched The error message suggests two solutions: running `apt-get update` to refresh the package list, or using `--fix-missing` to attempt installation despite fetch failures.

Typical symptoms

  • apt-get update or apt-get install fails with 'Unable to fetch some archives' message
  • Installation stops mid-process without completing
  • You see '404 Not Found' errors for specific packages
  • apt reports 'broken' or 'unmet dependencies'
  • Previous failed installations prevent new installations from completing
  • sudo apt-get install command hangs or times out when trying to fetch packages

Common causes

  1. Local package cache is out of sync with remote repositories (outdated package lists)
  2. Network connectivity issues or unstable internet connection during download
  3. Repository mirror is temporarily offline, overloaded, or misconfigured
  4. Package repository suite has changed but your system hasn't acknowledged the change
  5. Previous apt operations were interrupted before completing (suspended updates or installations)
  6. Repository URLs in /etc/apt/sources.list are incorrect or pointing to dead mirrors
  7. Firewall or proxy blocking access to repository servers
  8. Broken package dependencies from partial installation attempts

How to fix "E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"

1Run apt-get update to refresh package lists

The first and most important step is to update your local package list to sync with the repositories.

bash
sudo apt-get update

This command refreshes the package index files from all configured repositories. It may show:
- "404 Not Found" errors for packages no longer available (safe to ignore)
- "Suite value changed" warnings (you may need to accept the change)

If you see 'Suite value changed' warnings:

bash
# The system is asking you to acknowledge that a repository has changed
# This is normal during system upgrades (e.g., from 20.04 to 22.04)
# The system will automatically handle it on the next update
sudo apt-get update

After this completes, try your original operation:

bash
sudo apt-get install package-name
2Use --fix-missing flag to skip failed packages

If apt-get update didn't fully resolve the issue, use the --fix-missing flag to attempt installation while skipping packages that cannot be fetched.

bash
sudo apt-get install --fix-missing

Or for a specific package:

bash
sudo apt-get install --fix-missing package-name

What --fix-missing does:
- Continues installation despite failed downloads
- Skips packages that cannot be fetched
- Allows other dependencies to be satisfied
- Leaves your system in a consistent state

Note: --fix-missing should be used after apt-get update. Using it without updating first may leave unmet dependencies.

3Clean and retry

If the above steps don't work, clean your package cache and retry.

bash
# Clean package cache
sudo apt-get clean

# Update package lists again
sudo apt-get update

# Try the installation again
sudo apt-get install package-name

What apt-get clean does:
- Removes all packages from the local download directory (/var/cache/apt/archives/)
- Frees up disk space
- Forces apt to re-download fresh copies of packages

Alternative: Use autoclean for partial cleanup

bash
# Keep newer package versions, remove older cached versions
sudo apt-get autoclean

# Update and retry
sudo apt-get update
sudo apt-get install package-name
4Fix broken packages with install -f

If you have broken dependencies preventing installations, use apt-get install -f (or apt --fix-broken).

bash
# Fix broken packages
sudo apt-get install -f

This command:
- Scans your system for broken package dependencies
- Attempts to resolve them by installing missing packages
- May remove conflicting packages if necessary

If you see unmet dependencies:

bash
# Check for held or conflicting packages
sudo apt-mark showhold

# See detailed dependency issues
sudo apt-get check
5Verify your repository configuration

Check that your repositories are correctly configured.

bash
# View your configured repositories
cat /etc/apt/sources.list

# Also check additional repository files
ls -la /etc/apt/sources.list.d/

Common issues:
- PPA repositories that are no longer maintained
- Repository URLs using outdated domain names
- Disabled repositories in sources.list.d/ files

On Ubuntu, restore default repositories:

bash
# Backup current sources
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

# Restore Ubuntu default repositories (requires knowing your release)
# First, find your Ubuntu release name
lsb_release -cs

# Then restore defaults (example for jammy/22.04)
# This varies by version - check Ubuntu documentation

Check for disabled PPAs:

bash
# List all PPAs (Personal Package Archives)
sudo apt-cache policy

# Remove problematic PPAs
sudo add-apt-repository --remove ppa:user/ppa-name
6Check disk space

Insufficient disk space can cause download failures.

bash
# Check available disk space
df -h

# Check space in /var partition (where packages are cached)
df -h /var

If disk space is low:

bash
# Clean package cache
sudo apt-get clean

# Remove old package versions
sudo apt-get autoclean

# Remove unused dependencies
sudo apt-get autoremove

If still low on space:

bash
# Find large files/directories
sudo du -sh /var/cache/*
sudo du -sh /var/log/*

# Clean old logs if necessary
sudo journalctl --vacuum=50M
7Use a different repository mirror

If your current repository mirror is slow or offline, switch to a different mirror.

On Ubuntu, edit sources.list:

bash
sudo nano /etc/apt/sources.list

Replace the mirror URL (example changing archive.ubuntu.com to a different mirror):

bash
# Original
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted

# Change to a different mirror (e.g., Ubuntu's mirror)
deb http://security.ubuntu.com/ubuntu/ jammy main restricted

Common Ubuntu mirrors:
- http://archive.ubuntu.com/ - Main archive
- http://security.ubuntu.com/ - Security updates
- http://br.archive.ubuntu.com/ - Brazil mirror
- http://mirror.example.com/ - Various regional mirrors

On Debian, use the official repository:

bash
# Debian sources.list example
deb http://deb.debian.org/debian bookworm main
deb http://deb.debian.org/debian-security bookworm-security main

After editing, update and retry:

bash
sudo apt-get update
sudo apt-get install package-name
8Verify network connectivity to repositories

Test your connection to repository servers.

bash
# Test connectivity to Ubuntu archive
curl -I http://archive.ubuntu.com

# Test connectivity to Debian repository
curl -I http://deb.debian.org

# Test DNS resolution
nslookup archive.ubuntu.com

If behind a proxy or firewall:

bash
# Configure apt to use a proxy
sudo nano /etc/apt/apt.conf.d/proxy.conf

# Add these lines (replace proxy-server:8080 with your proxy)
Acquire::http::Proxy "http://proxy-server:8080/";
Acquire::https::Proxy "http://proxy-server:8080/";

Test with curl using proxy:

bash
curl -x http://proxy-server:8080 -I http://archive.ubuntu.com

After verifying connectivity:

bash
sudo apt-get update
sudo apt-get install package-name

Advanced notes

### Understanding Package Fetch Failures

When apt reports "Unable to fetch some archives," it means one or more package files couldn't be downloaded. This is different from dependency resolution errors.

Common scenarios:

1. Partial failure with --fix-missing recovery:
Some packages fail to fetch, but core dependencies are available. Using --fix-missing allows the installation to proceed with available packages.

2. Repository suite changes (Ubuntu releases):
When upgrading from one Ubuntu version to another (e.g., 20.04 to 22.04), repositories change their "Suite" designation from "focal" to "jammy". This requires explicit acknowledgment.

3. Mirror synchronization lag:
Repository mirrors don't sync instantaneously. If you see "404 Not Found" for newly released packages, waiting a few minutes before retrying often resolves the issue.

4. Docker/Container context:
This error is especially common in Dockerfiles because:
- The base image's package mirror may be slow or unreliable
- Build environments may have network restrictions
- Multiple build steps retrying the same operations

For Dockerfiles, the recommended fix is:

dockerfile
RUN apt-get update && \
       apt-get install -y --no-install-recommends \
         package1 \
         package2 && \
       apt-get clean && \
       rm -rf /var/lib/apt/lists/*

### Best Practices

Always update before installing:

bash
sudo apt-get update && sudo apt-get install package-name

Use apt instead of apt-get (on newer systems):

bash
# Modern alternative (Ubuntu 18.04+)
sudo apt update
sudo apt install package-name

Keep your system clean:

bash
# Regular maintenance
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean

For reliable production deploys:
- Pin specific package versions to avoid unexpected changes
- Maintain a local mirror of critical packages
- Test updates in a staging environment first
- Document your repository configuration in version control

Frequently asked questions

What does "E: Unable to fetch some archives, maybe run apt-get update or try with" mean?
The "Unable to fetch some archives" error in apt means that the package manager encountered one or more packages it couldn't download from the configured software repositories. This can happen for several reasons: - Your local package list is out of sync with the repository (missing or broken package references) - Network connectivity issues preventing downloads from repository mirrors - Repository URLs are incorrect, outdated, or the servers are temporarily unavailable - Previous installation attempts were interrupted, leaving your package system in a partially broken state - The package you're trying to install has unmet dependencies that cannot be fetched The error message suggests two solutions: running apt-get update to refresh the package list, or using --fix-missing to attempt installation despite fetch failures.
How do I fix "E: Unable to fetch some archives, maybe run apt-get update or try with"?
This error occurs when apt-get cannot download packages from your configured repositories due to network issues, outdated package lists, or missing/broken packages. It typically indicates that some packages failed to fetch during installation and you need to retry or fix broken dependencies.
What causes "E: Unable to fetch some archives, maybe run apt-get update or try with"?
Local package cache is out of sync with remote repositories (outdated package lists) Network connectivity issues or unstable internet connection during download Repository mirror is temporarily offline, overloaded, or misconfigured
Is the "E: Unable to fetch some archives, maybe run apt-get update or try with" error serious?
It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading