When try to update the Ubuntu 20.04 version to latest using command ‘sudo apt update’, it throws the below error:
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease Hit:4 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease Err:5 http://id.archive.ubuntu.com/ubuntu focal InRelease 403 Forbidden Err:6 http://id.archive.ubuntu.com/ubuntu focal-updates InRelease 403 Forbidden Err:7 http://id.archive.ubuntu.com/ubuntu focal-backports InRelease 403 Forbidden Reading package lists... Done N: See apt-secure(8) manpage for repository creation and user configuration details. N: Updating from such a repository can't be done securely, and is therefore disabled by default. E: The repository 'http://id.archive.ubuntu.com/ubuntu focal InRelease' is no longer signed. E: Failed to fetch http://id.archive.ubuntu.com/ubuntu/dists/focal/InRelease 403 Forbidden E: Failed to fetch http://id.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease 403 Forbidden
This issue is basically seen because of two reasons:
Either you are connected to any restricted network to connect your system, so try to switch the network between WiFi/Mobile and run the command ‘sudo apt update’ again. It would fix the error for you.
Second and most common reason is, that Personal Package Archive (PPA) source is creating the issue and not allowing to update the Ubuntu version to latest. There is any invalid repository that gives 403 Forbidden error and causing the problem.
Developers can make their software available on Debian, Ubuntu, and other Debian-based distributions via Personal Package Archive (PPA).
With PPA, developers can create their own repository and urge users to add it to the sources rather than depending on their program being accepted in the standard Ubuntu repositories.
However, you can publish your own private repository through Launchpad for other Ubuntu users to access if you want to distribute some software that isn’t available in any of standard Ubuntu repositories. These third-party repositories are known as PPA.
So many times, these 3rd party repositories create the issue into updating the Ubuntu to latest version and shows the 403 Forbidden errors in sequence.
To fix the Ubuntu 20.04 version update error, disable the PPA by commenting out the source list which restricting to the update the code.
Steps to Disable PPA Source List:
Step 1: Find all Enabled Binary Software Source
Run the below command to search all the enabled binary PPA software sources:
$ grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
You would be able to see the output for all the enabled software source lists and the source list name which is creating the issue for you.
Step 2: Delete the required Source list
Now delete that particular source list and run the command ‘$ sudo apt-get update’ and you would be able to run the command without any error and Ubuntu would be updated to latest version without any issue.