Ubuntu升级python3.6遇到403 Forbidden问题解决方法

在Ubuntu16.04中遇到升级Python3.5至3.6版本时的403错误,通过更换PPA源解决了sudo apt-get update的问题。

今天打算在ubuntu16.04上将自带的python3.5升级到3.6版本,网上提供的步骤如下:

https://blog.youkuaiyun.com/qq_42690811/article/details/94849491

https://www.jianshu.com/p/3d3ea1dabb16

还有很多其它链接都是相同的方法,但是我这边在升级的时候到了sudo apt-get update步骤都显示:

 

Ign:16 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:17 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main DEP-11 64x64 Icons
Ign:8 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
Ign:11 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main i386 Packages
Ign:12 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main all Packages
Ign:14 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main Translation-en_US
Ign:15 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main Translation-en
Ign:16 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:17 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main DEP-11 64x64 Icons
Err:8 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
  403  Forbidden [IP: 91.189.95.83 80]
Ign:11 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main i386 Packages
Ign:12 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main all Packages
Ign:14 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main Translation-en_US
Ign:15 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main Translation-en
Ign:16 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 DEP-11 Metadata
Ign:17 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main DEP-11 64x64 Icons
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 [IP: 91.189.95.83 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

后来百度了很多个还是没有找到解决方法,后来换必应搜了几次找到了解决办法,搜到的还是日本人的网站,虽然不懂日语,但是命令贴出来了,用了一下确实可以:

https://qiita.com/pudding167/items/1d7226155cbfcd76bb1a

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.6

最后说一句:太君威武,百度垃圾!!!

                                                              

panano@panano-ThinkStation-P720:~$ sudo apt-get update Hit:1 http://mirrors.tools.huawei.com/ubuntu focal InRelease Hit:2 http://mirrors.tools.huawei.com/ubuntu focal-security InRelease Hit:3 http://cn.archive.ubuntu.com/ubuntu focal InRelease Hit:4 http://mirrors.tools.huawei.com/ubuntu focal-updates InRelease Get:5 http://mirrors.tools.huawei.com/docker-ce/linux/ubuntu focal InRelease Hit:6 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease Hit:7 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease Err:8 http://lenovo.archive.canonical.com focal InRelease 403 Forbidden [IP: 127.0.0.1 3128] Err:9 http://packages.ros.org/ros/ubuntu focal InRelease 403 Forbidden [IP: 127.0.0.1 3128] Hit:10 http://security.ubuntu.com/ubuntu focal-security InRelease Reading package lists... Done E: Failed to fetch http://lenovo.archive.canonical.com/dists/focal/InRelease 403 Forbidden [IP: 127.0.0.1 3128] E: The repository 'http://lenovo.archive.canonical.com focal InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch http://packages.ros.org/ros/ubuntu/dists/focal/InRelease 403 Forbidden [IP: 127.0.0.1 3128] E: The repository 'http://packages.ros.org/ros/ubuntu focal InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.
07-05
虽然给定引用中未直接提及VM中Ubuntu安装gcc遇到403 forbidden错误的解决办法,但可以参考类似错误的解决思路。 在引用[1]中,访问localhost:80报403 forbidden是因为配置文件里index目录没加上,在`/var/www/html`里找到加到配置文件index之后解决问题。对于VM中Ubuntu安装gcc遇到403 forbidden错误,可能是软件源配置问题。可以尝试以下步骤: 1. **检查软件源配置**:打开软件源配置文件,通常是`/etc/apt/sources.list`,确保其中的软件源地址正确且可用。 ```bash sudo nano /etc/apt/sources.list ``` 2. **更新软件源**:更新软件源信息,让系统重新获取可用软件包列表。 ```bash sudo apt update ``` 3. **尝试更换软件源**:如果当前软件源无法访问,可以更换为其他可靠的软件源,如阿里云、清华大学等的镜像源。例如,将阿里云的Ubuntu镜像源添加到`/etc/apt/sources.list`文件中: ```plaintext deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse ``` 然后再次执行更新命令: ```bash sudo apt update ``` 4. **检查权限**:确保当前用户有足够的权限进行软件安装操作。通常使用`sudo`命令可以提升权限。
评论 9
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值