当我使用如下命令在ubuntu20.04上下载gcc11的时候,出现了错误
sudo apt install gcc-11 g++-11
错误:
Err:1 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 gcc-13-base amd64 13.1.0-8ubuntu1~20.04.2
Could not connect to ppa.launchpad.net:80 (2620:2d:4000:1::3e), connection timed out Could not connect to ppa.launchpad.net:80 (185.125.190.52), connection timed out
Err:2 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libgcc-s1 amd64 13.1.0-8ubuntu1~20.04.2
Unable to connect to ppa.launchpad.net:http:
Err:3 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libstdc++6 amd64 13.1.0-8ubuntu1~20.04.2
Unable to connect to ppa.launchpad.net:http:
Err:4 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 gcc-11-base amd64 11.4.0-2ubuntu1~20.04
Unable to connect to ppa.launchpad.net:http:
Err:5 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 cpp-11 amd64 11.4.0-2ubuntu1~20.04
Unable to connect to ppa.launchpad.net:http:
Err:6 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libcc1-0 amd64 13.1.0-8ubuntu1~20.04.2
Unable to connect to ppa.launchpad.net:http:
Err:7 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libtsan0 amd64 11.4.0-2ubuntu1~20.04
Unable to connect to ppa.launchpad.net:http:
Err:8 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libgomp1 amd64 13.1.0-8ubuntu1~20.04.2
Unable to connect to ppa.launchpad.net:http:
Err:9 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libitm1 amd64 13.1.0-8ubuntu1~20.04.2
Unable to connect to ppa.launchpad.net:http:
Err:10 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal/main amd64 libatomic1 amd64 13.1.0-8ubuntu1~20.04.2
…
E: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/pool/main/g/gcc-13/gcc-13-base_13.1.0-8ubuntu1~20.04.2_amd64.deb Could not connect to ppa.launchpad.net:80 (2620:2d:4000:1::3e), connection timed out Could not connect to ppa.launchpad.net:80 (185.125.190.52), connection timed out
E: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/pool/main/g/gcc-13/libgcc-s1_13.1.0-8ubuntu1~20.04.2_amd64.deb Unable to connect to ppa.launchpad.net:http:
E: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu/pool/main/g/gcc-13/libstdc++6_13.1.0-8ubuntu1~20.04.2_amd64.deb Unable to connect to ppa.launchpad.net:http:
Solution
挂了梯子去google搜寻后,有大佬给出以下建议:
When I experience this (occasionally with no network changes), I find that using apt-get instead of apt works.
意思就是将apt换成apt-get
sudo apt-get install gcc-11 g++-11
结果这种方法还真的成功,真的让我匪夷所思,我也不知道原因。
如果有知道原因的友友,欢迎评论~