【Linux】Ubuntu20.04 无法访问 http://cn.archive.ubuntu.com 问题记录解决

问题描述

在这里插入图片描述

您希望继续执行吗? [Y/n] Y
错误:1 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 binfmt-support amd64 2.2.0-2
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达) 无法连接上 cn.archive.ubuntu.com:80 (91.189.91.38),连接超时 无法连接上 cn.archive.ubuntu.com:80 (91.189.91.39),连接超时
错误:2 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 libllvm11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:3 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 libclang-cpp11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:4 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 libclang-common-11-dev amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:5 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 libclang1-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:6 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clang-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
忽略:7 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clang-11-doc all 1:11.0.0-2~ubuntu20.04.1
错误:8 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clang-format-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:9 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clang-tools-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:10 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clang-tidy-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:11 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clangd-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:12 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libc++abi1-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:13 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libc++1-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:14 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libc+±11-dev amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:15 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libc++abi-11-dev amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:16 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 libclang-11-dev amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:17 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libomp5-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:18 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libomp-11-dev amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:19 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 llvm-11-runtime amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:20 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libpfm4 amd64 4.10.1+git20-g7700f49-2
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:21 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 llvm-11 amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:22 http://cn.archive.ubuntu.com/ubuntu focal/main amd64 libffi-dev amd64 3.3-4
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
忽略:23 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 python3-pygments all 2.3.1+dfsg-1ubuntu2.2
错误:24 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 llvm-11-tools amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:25 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libz3-4 amd64 4.8.7-4build1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:26 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 libz3-dev amd64 4.8.7-4build1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:27 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 llvm-11-dev amd64 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)
错误:7 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 clang-11-doc all 1:11.0.0-2~ubuntu20.04.1
无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::18) 的连接 - connect (101: 网络不可达) 无法发起与 cn.archive.ubuntu.com:80 (2001:67c:1562::15) 的连接 - connect (101: 网络不可达)

问题分析

http://cn.archive.ubuntu.com
这个地址应该是挂了,此外尝试挂了梯子仍无法解决,最后决定换个国内源

问题解决

  1. 打开 apt 源的配置文件
sudo vim /etc/apt/sources.list
  1. 将其中 http://cn.archive.ubuntu.com 全部替换成阿里源 http://mirrors.aliyun.com
    在这里插入图片描述
    # deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted
     
    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of the distribution.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
    
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team. Also, please note that software in universe WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal universe
    deb http://mirrors.aliyun.com/ubuntu/ focal universe
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
    ## team, and may not be under a free licence. Please satisfy yourself as to 
    ## your rights to use the software. Also, please note that software in 
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal multiverse
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    
    ## N.B. software from this repository may not have been tested as
    # deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted
    
    # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    # newer versions of the distribution.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal main restricted
    
    ## Major bug fix updates produced after the final release of the
    ## distribution.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates main restricted
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team. Also, please note that software in universe WILL NOT receive any
    ## review or updates from the Ubuntu security team.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal universe
    deb http://mirrors.aliyun.com/ubuntu/ focal universe
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal universe
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates universe
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates universe
    
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
    ## team, and may not be under a free licence. Please satisfy yourself as to 
    ## your rights to use the software. Also, please note that software in 
    ## multiverse WILL NOT receive any review or updates from the Ubuntu
    ## security team.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal multiverse
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal multiverse
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates multiverse
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-updates multiverse
    
    ## N.B. software from this repository may not have been tested as
    ## extensively as that contained in the main release, although it includes
    ## newer versions of some applications which may provide useful features.
    ## Also, please note that software in backports WILL NOT receive any review
    ## or updates from the Ubuntu security team.
    # deb http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    # deb-src http://cn.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
    
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository.
    ## This software is not part of Ubuntu, but is offered by Canonical and the
    ## respective vendors as a service to Ubuntu users.
    # deb http://archive.canonical.com/ubuntu focal partner
    # deb-src http://archive.canonical.com/ubuntu focal partner
    
    # deb http://security.ubuntu.com/ubuntu focal-security main restricted
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted
    # deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
    # deb http://security.ubuntu.com/ubuntu focal-security universe
    deb http://mirrors.aliyun.com/ubuntu/ focal-security universe
    # deb-src http://security.ubuntu.com/ubuntu focal-security universe
    # deb http://security.ubuntu.com/ubuntu focal-security multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-security multiverse
    # deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
    
    # This system was installed using small removable media
    # (e.g. netinst, live or single CD). The matching "deb cdrom"
    # entries were disabled at the end of the installation process.
    # For information about how to configure apt package sources,
    # see the sources.list(5) manual.
    deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
    # deb-src https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
    
    ### note: 未注释的配置上方一行为原来的配置,还原只需交换相应的注释即可
    
    实践发现,http://security.ubuntu.com/ubuntu 这个也挂了,所以将它也替换成阿里源
  2. 更新 apt
    sudo apt update
    
    在这里插入图片描述
    全部命中!解决

额外说明

1. 备份

为了方便还原或者出现其他不可名状的错误,你应该在执行上述步骤前做好备份

cp /etc/apt/sources.list /etc/apt/sources.list.bak

2. 替换命令

sudo sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list

其他源

中科大:mirrors.aliyun.com

参考文章

1. Ubuntu 更换国内源【个人博客】
2. ubuntu官方国内源【CSDN】

  • 18
    点赞
  • 56
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论
首先,你需要安装 `sysbench`。在 Ubuntu 上,你可以通过以下命令安装: ```bash sudo apt-get update sudo apt-get install sysbench ``` 安装完成后,你可以使用以下命令下载 `TPCC` 测试文件: ```bash wget https://gitee.com/xiaoluoji/sysbench-tpcc/archive/master.zip ``` 解压文件: ```bash unzip master.zip ``` 进入解压后的文件夹: ```bash cd sysbench-tpcc-master ``` 创建 `tpcc` 数据库: ```bash sysbench --db-driver=mysql --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=yourpassword --mysql-db=tpcc --range_size=100 --table_size=100000 --tables=10 --threads=1 --time=0 prepare ``` 上述命令中,你需要替换 `yourpassword` 为你的 MySQL 数据库密码。 运行 `TPCC` 测试: ```bash sysbench --db-driver=mysql --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=yourpassword --mysql-db=tpcc --range_size=100 --table_size=100000 --tables=10 --threads=32 --time=300 run ``` 上述命令中,你需要替换 `yourpassword` 为你的 MySQL 数据库密码。这里我设置了 `threads` 为 32, `time` 为 300 秒,你可以根据你的需要进行调整。 完成测试后,你可以清理 `tpcc` 数据库: ```bash sysbench --db-driver=mysql --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=yourpassword --mysql-db=tpcc cleanup ``` 注意:在执行 TPCC 测试之前,你需要先在 MySQL 数据库中创建一个名为 `tpcc` 的数据库。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小胡同的诗

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值