I've been using Ubuntu 16.04 vagrant machine for quite some time now. I wanted to install a package, for which I had to do sudo apt-get update
before.
But when I ran this command in my machine, it failed with the following error:
Err:12 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
403 Forbidden
Ign:13 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main Translation-en
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/main/binary-amd64/Packages 403 Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.
It looked like there is an invalid repository which gives 403 error
So as a workaround, I thought of temporarily commenting out that in source list.
I grepped all the enabled binary sources by running this command:
grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
which gave output:
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial main restricted
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial universe
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial-updates universe
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security universe
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu xenial-security multiverse
/etc/apt/sources.list:deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable
/etc/apt/sources.list.d/jonathonf-ubuntu-python-3_6-xenial.list:deb http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial main
/etc/apt/sources.list.d/nodesource.list:deb https://deb.nodesource.com/node_8.x xenial main
So in my case jonathonf-ubuntu-python-3_6-xenial.list
has the problem.
So I commented out the content in /etc/apt/sources.list.d/jonathonf-ubuntu-python-3_6-xenial.list
, which now looks like:
# deb http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial main
# deb-src http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial main
Now when I ran sudo apt-get update
again after this fix, it worked fine for me.
If you are facing the above error, you can also use this as a workaround and if you have a better solution please let me know :)
Have a great day!
Top comments (14)
Thanks a lot, @deepika_banoth right when I was struggling with this error, you showed up in your superhero outfit and saved the day :)
Glad it helped :)
DAMN! When I Googling... your article show on the top of the page, then I click! My problem has been solved! Thanks
how to comment the command in terminal or in some other?Please reply me..I need that
just add # (hashtag), example:
change to
Hi! Do I comment on the terminal?
I still get the same error when running sudo apt-get update
E: Failed to fetch ppa.launchpad.net/jonathonf/python... 403 Forbidden
sudo gedit then comment out
thanks very much,could you help to see the bugs i meet,they are a lot different from yours,and i can not solve them,i will appreciate very much if you can help @deepika_banoth
(base) dsp@dsp-Default-string:/$ grep -r --include '*.list' '^deb ' /etc/apt/sources.list /etc/apt/sources.list.d/
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial main restricted
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial universe
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial-updates universe
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial multiverse
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
/etc/apt/sources.list:deb us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list:deb security.ubuntu.com/ubuntu xenial-security main restricted
/etc/apt/sources.list:deb security.ubuntu.com/ubuntu xenial-security universe
/etc/apt/sources.list:deb security.ubuntu.com/ubuntu xenial-security multiverse
/etc/apt/sources.list.d/github_git-lfs.list:deb packagecloud.io/github/git-lfs/ubu... xenial main
/etc/apt/sources.list.d/teamviewer.list:deb linux.teamviewer.com/deb stable main
/etc/apt/sources.list.d/vscode.list:deb [arch=amd64] packages.microsoft.com/repos/vscode stable main
/etc/apt/sources.list.d/cuda-9-2-local.list:deb file:///var/cuda-repo-9-2-local /
/etc/apt/sources.list.d/cuda-9-0-local.list:deb file:///var/cuda-repo-9-0-local /
/etc/apt/sources.list.d/jonathonf-ubuntu-python-3_6-xenial.list:deb ppa.launchpad.net/jonathonf/python... xenial main
@eie1 I see this in your list:
jonathonf-ubuntu-python-3_6-xenial.list
. Do try commenting it(/etc/apt/sources.list.d/jonathonf-ubuntu-python-3_6-xenial.list
) out.Thanks @deepika_banoth this helped me
Glad it helped :)
Thank you for you kindly post and you save my life, thanks god.
You saved my day!
Thanks alot this worked for me :)