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.
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.
First, determine which repositories are causing the 403 error:
sudo apt update 2>&1 | grep -i "failed\|403"This will show you the specific repository URLs that are returning 403 errors.
View all currently enabled repository sources to identify problematic ones:
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.
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:
sudo rm /etc/apt/sources.list.d/repository-name.list
sudo rm /etc/apt/sources.list.d/repository-name.list.saveFor example, if jonathonf-python-3.6-ubuntu.list is failing:
sudo rm /etc/apt/sources.list.d/jonathonf-python-3.6-ubuntu.list*If the repository URLs use HTTP, try switching to HTTPS for better compatibility:
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.listThen try updating again:
sudo apt updateIf 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:
sudo sed -i 's|http://deb.debian.org|https://deb.debian.org|g' /etc/apt/sources.listIf 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:
sudo apt updateIf the issue persists, verify network connectivity:
# 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.comIf 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):
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1After making changes, verify that apt update works correctly:
sudo apt update
sudo apt upgrade -yIf all repositories are now accessible, you should see success messages for each repository source.
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.
E: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT