admin 管理员组文章数量: 1184232
搜了很多博文,都只说要换ubuntu版本对应的各种源
然而我的源版本正确,ubuntu、中科大、阿里、清华等等源也全部试过了,依然不行
直到终于决定自己解决不了了去问师兄,加一个指定http端口的选项立刻解决!!
环境:ubuntu 20.04
网络:服务器本身不可上网,用自己的电脑进行ssh反向代理,使服务器能通过http联网
最终使用的source.list:
deb http://archive.ubuntu/ubuntu/ trusty main universe restricted multiverse
#默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.tuna.tsinghua.edu/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu/ubuntu/ focal-backports main restricted universe multiverse
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb http://security.ubuntu/ubuntu/ focal-security main restricted universe multiverse
# deb-src http://security.ubuntu/ubuntu/ focal-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu/ubuntu/ focal-proposed main restricted universe multiverse
# # deb-src https://mirrors.tuna.tsinghua.edu/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun/ubuntu/ trusty-backports main restricted universe multiverse
解决:
把一般的
sudo apt update
换成(我服务器设置的http代理端口是7890)
sudo apt -o Acquire::http::proxy="http://127.0.0.1:7890/" update
结果:
更新得非常解压!
P.S. 反向代理命令:
在本机终端输入
ssh -p 22 <服务器用户名>@<服务器ip> -R <服务器给http代理的端口>:127.0.0.1:<本机代理端口,一般是7890,见梯子软件>
接着会输入密码进入服务器终端,继续输入
export http_proxy="http://127.0.0.1:<服务器给http代理的端口>"
最后还是要非常感谢神通广大的师兄的援助!(不知道师兄的csdn账号,只能在这里表达万分的感激!!)
版权声明:本文标题:Ubuntu20.04国内镜像源apt update连接失败终极解决 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/b/1767943920a3520414.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论