我已连接到大学路由器,我知道他们有很多限制,但 Firefox 可以毫无问题地访问 repo 链接,但终端不能。
我怎样才能让终端使用与 Firefox 相同的协议?
我的 Ubuntu 版本是 18.04 LTS
另外,ubuntu 软件包管理器看起来可以工作,因为我可以启动 VLC 的安装,但从未超过 6-8%,每次都会超时。
我尝试使用 Synaptic,但同样的 403 Forbidden。
我尝试使用代理,通过手机上的 ssh 隧道建立我的连接,但包管理器(apt 或 synaptic)没有通过身份验证阶段。
另外,我知道大学正在使用 fortiguard,但正如我所说,我可以使用 Firefox 访问所有远程 repo。
wadaane@wadaane-ubuntu:~$ sudo apt update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
403 Forbidden [IP: 91.189.91.26 80]
Err:2 http://sy.archive.ubuntu.com/ubuntu bionic InRelease
403 Forbidden [IP: 91.189.88.161 80]
Err:3 http://sy.archive.ubuntu.com/ubuntu bionic-updates InRelease
403 Forbidden [IP: 91.189.88.162 80]
Err:4 http://sy.archive.ubuntu.com/ubuntu bionic-backports InRelease
403 Forbidden [IP: 91.189.88.162 80]
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://security.ubuntu.com/ubuntu bionic-security InRelease' is no longer signed.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease 403 Forbidden [IP: 91.189.91.26 80]
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://sy.archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
E: Failed to fetch http://sy.archive.ubuntu.com/ubuntu/dists/bionic/InRelease 403 Forbidden [IP: 91.189.88.161 80]
E: Failed to fetch http://sy.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease 403 Forbidden [IP: 91.189.88.162 80]
E: The repository 'http://sy.archive.ubuntu.com/ubuntu bionic-updates 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://sy.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease 403 Forbidden [IP: 91.189.88.162 80]
E: The repository 'http://sy.archive.ubuntu.com/ubuntu bionic-backports 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.
编辑:
这是 tcpdump 的截断输出:
22:15:22.144893 IP wadaane-ubuntu.32779 > 172.18.3.2.domain: 62851+ [1au] PTR? 23.91.189.91.in-addr.arpa. (54)
22:15:22.152815 IP 172.18.3.2.domain > wadaane-ubuntu.32779: 62851 1/0/1 PTR economy.canonical.com. (89)
22:15:22.144309 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [S], seq 704597193, win 29200, options [mss 1460,sackOK,TS val 2654335473 ecr 0,nop,wscale 7], length 0
22:15:22.152697 IP economy.canonical.com.http > wadaane-ubuntu.36120: Flags [S.], seq 2352942977, ack 704597194, win 5792, options [mss 1460,sackOK,TS val 746784843 ecr 2654335473,nop,wscale 7], length 0
22:15:22.152765 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [.], ack 1, win 229, options [nop,nop,TS val 2654335482 ecr 746784843], length
22:15:22.153117 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [P.], seq 1:160, ack 1, win 229, options [nop,nop,TS val 2654335482 ecr 746784843], length 159: HTTP: GET /ubuntu/dists/bionic/InRelease HTTP/1.1
22:15:22.168911 IP economy.canonical.com.http > wadaane-ubuntu.36120: Flags [P.], seq 1:1449, ack 160, win 5792, options [nop,nop,TS val 746784843 ecr 2654335482], length 1448: HTTP: HTTP/1.1 403 Forbidden
22:15:22.168951 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [.], ack 1449, win 251, options [nop,nop,TS val 2654335498 ecr 746784843], length 0
22:15:22.169724 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [F.], seq 160, ack 1449, win 251, options [nop,nop,TS val 2654335499 ecr 746784843], length 0
22:15:22.178134 IP economy.canonical.com.http > wadaane-ubuntu.36120: Flags [P.], seq 1449:2897, ack 160, win 5792, options [nop,nop,TS val 746784843 ecr 2654335482], length 1448: HTTP
22:15:22.178177 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [R], seq 704597353, win 0, length 0
22:15:22.179030 IP economy.canonical.com.http > wadaane-ubuntu.36120: Flags [FP.], seq 2897:2912, ack 160, win 5792, options [nop,nop,TS val 746784843 ecr 2654335482], length 15: HTTP
22:15:22.179049 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [R], seq 704597353, win 0, length 0
22:15:22.185000 IP economy.canonical.com.http > wadaane-ubuntu.36120: Flags [.], ack 161, win 5792, options [nop,nop,TS val 746784843 ecr 2654335499], length 0
22:15:22.185182 IP wadaane-ubuntu.36120 > economy.canonical.com.http: Flags [R], seq 704597354, win 0, length 0
答案1
好吧,网络问题无法解决,正如大多数人所说,这是 IT 部门的事情。
所以最终的解决方案是使用 apt-offline。
答案2
删除现有软件包,然后尝试以下操作:
dns-nameserver 8.8.8.8
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
apt-get update
apt-get upgrade