How to fix W: Failed to fetch URL 403 Forbidden in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 187 views

This error occurs when apt cannot access a repository due to HTTP 403 access restrictions. Common causes include deprecated PPAs, repository configuration mismatches, or network issues.

Quick fix

Fixes W: Failed to fetch URL 403 Forbidden

sudo apt update 2>&1 | grep -i "failed\|403"
  1. Identify failing repositories
  2. List all enabled repositories
  3. Disable or remove problematic PPAs
  4. Switch HTTP repositories to HTTPS
apt โ€” error
sudo apt update 2>&1 | grep -i "failed\|403"
W: Failed to fetch URL 403 Forbidden

What this error means

The APT package manager attempted to fetch package metadata from a configured repository, but the server rejected the request with HTTP 403 Forbidden. This indicates the connection succeeded, but the server denied access to the requested resource. The 403 error typically means the repository is either no longer available, configured for a different system version, or the source list contains invalid entries.

Typical symptoms

  • apt update or apt-get update fails with 403 Forbidden errors
  • W: Failed to fetch messages appear for one or more repositories
  • Cannot install or upgrade packages due to update failures
  • Specific PPA repositories are inaccessible while others work

Common causes

  1. Deprecated or discontinued PPA repositories that no longer exist or have been removed
  2. Repository source configured for a different Ubuntu/Debian version than the system
  3. Invalid or outdated repository entries in /etc/apt/sources.list or /etc/apt/sources.list.d/
  4. Network connectivity issues between the system and the repository server
  5. HTTP proxy or firewall rules blocking access to specific repositories
  6. Repository server-side access restrictions or rate limiting
  7. Bug in older APT versions with incorrect HTTP redirect handling

How to fix "W: Failed to fetch URL 403 Forbidden"

1Identify failing repositories

First, determine which repositories are causing the 403 error:

bash
sudo apt update 2>&1 | grep -i "failed\|403"

This will show you the specific repository URLs that are returning 403 errors.

2List all enabled repositories

View all currently enabled repository sources to identify problematic ones:

bash
grep -r --include='*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/

Note any PPAs or third-party repositories that appear suspicious or unfamiliar.

3Disable or remove problematic PPAs

Remove or disable the failing repositories. For PPAs, you have several options:

Option A: Via GUI (Ubuntu/Linux Mint)
1. Open Software Sources from the system menu
2. Find the problematic repository in the PPAs or Additional Repositories tab
3. Uncheck it to disable it
4. Click Close

Option B: Via command line
Find and remove the problematic .list file:

bash
sudo rm /etc/apt/sources.list.d/repository-name.list
sudo rm /etc/apt/sources.list.d/repository-name.list.save

For example, if jonathonf-python-3.6-ubuntu.list is failing:

bash
sudo rm /etc/apt/sources.list.d/jonathonf-python-3.6-ubuntu.list*
4Switch HTTP repositories to HTTPS

If the repository URLs use HTTP, try switching to HTTPS for better compatibility:

bash
sudo sed -i 's|http://archive.ubuntu.com|https://archive.ubuntu.com|g' /etc/apt/sources.list
sudo sed -i 's|http://security.ubuntu.com|https://security.ubuntu.com|g' /etc/apt/sources.list

Then try updating again:

bash
sudo apt update
5Use alternative repository mirrors

If the default repository is still inaccessible, switch to an alternative mirror:

On Ubuntu:
1. Open Software Sources
2. In the Ubuntu Software tab, change the Download from dropdown to a different server (e.g., a regional mirror)
3. Click Close and try updating again

On Debian:
Switch to deb.debian.org which provides reliable access:

bash
sudo sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.list
6Linux Mint-specific fix

If you're on Linux Mint, try the maintenance cleanup:

1. Open Software Sources from the system menu
2. Click the Maintenance tab at the bottom
3. Click "Purge residual configuration"
4. Close Software Sources
5. Try updating again:

bash
sudo apt update
7Check network and DNS configuration

If the issue persists, verify network connectivity:

bash
# Test DNS resolution
nslookup archive.ubuntu.com

# Test HTTP connectivity to a repository
curl -I http://archive.ubuntu.com/ubuntu/dists/

# Check for IPv6 issues
ping6 archive.ubuntu.com

If IPv6 connectivity is causing problems, you can disable IPv6:

Via Network Settings GUI:
1. Open Network Connections
2. Edit your connection
3. Go to IPv6 tab
4. Set dropdown to "Ignore"
5. Save and restart the network connection

Via command line (temporary):

bash
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
8Verify the fix

After making changes, verify that apt update works correctly:

bash
sudo apt update
sudo apt upgrade -y

If all repositories are now accessible, you should see success messages for each repository source.

Advanced notes

The 403 Forbidden error indicates a successful connection but denied access. This differs from connection timeout errors (connection refused) or DNS errors. A 403 response typically comes from the repository server itself, not from network firewalls or proxies. If you're behind a corporate proxy, you may need to configure APT to use the proxy. Older versions of APT have a known bug with HTTP 302 redirects that can incorrectly return 403 errors; updating APT may resolve this. Some CI/CD systems like CircleCI have had issues with 403 errors due to IP-based rate limiting or access restrictions.

Frequently asked questions

What does "W: Failed to fetch URL 403 Forbidden" mean?
The APT package manager attempted to fetch package metadata from a configured repository, but the server rejected the request with HTTP 403 Forbidden. This indicates the connection succeeded, but the server denied access to the requested resource. The 403 error typically means the repository is either no longer available, configured for a different system version, or the source list contains invalid entries.
How do I fix "W: Failed to fetch URL 403 Forbidden"?
This error occurs when apt cannot access a repository due to HTTP 403 access restrictions. Common causes include deprecated PPAs, repository configuration mismatches, or network issues.
What causes "W: Failed to fetch URL 403 Forbidden"?
Deprecated or discontinued PPA repositories that no longer exist or have been removed Repository source configured for a different Ubuntu/Debian version than the system Invalid or outdated repository entries in /etc/apt/sources.list or /etc/apt/sources.list.d/
Is the "W: Failed to fetch URL 403 Forbidden" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading