Ubuntu镜像源cn.arichinve.ubuntu.com不可用原因分析和解决
- 其他
- 2025-08-18 06:36:01

文章目录 Ubuntu查看系统版本Ubuntu更新系统不能更新Ubuntu查看APT更新源配置cn.archive.ubuntu 已经自动跳转到清华镜像站Ubuntu变更镜像源地址备份原文件批量在VIM中变更 Ubuntu国内镜像站推荐推荐阅读 今天想要在Ubuntu环境下搭建一个测试环境,进入Ubuntu系统后,先看了下系统版本 Ubuntu查看系统版本 lsb_release -a Ubuntu更新系统不能更新 sudo apt-get update
在执行后,发现报错如下,发现一个很奇怪的现象,我明明记得源配置的是cn.archive.ubuntu ,但是发现,系统更新时,自动去找了清华大学的Ubuntu源。why?难道是我源配置的是清华的吗?
Err:5 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease 503 Service Unavailable [IP: 185.125.190.52 80] Err:1 http://mirrors.tuna.tsinghua.edu /ubuntu bionic InRelease 503 Service Unavailable [IP: 101.6.15.130 80] Err:2 http://mirrors.tuna.tsinghua.edu /ubuntu bionic-updates InRelease 503 Service Unavailable [IP: 101.6.15.130 80] Err:3 http://mirrors.tuna.tsinghua.edu /ubuntu bionic-backports InRelease 503 Service Unavailable [IP: 101.6.15.130 80] Err:4 http://mirrors.tuna.tsinghua.edu /ubuntu bionic-security InRelease 503 Service Unavailable [IP: 101.6.15.130 80] Reading package lists... Done Ubuntu查看APT更新源配置 sudo vim /etc/apt/sources.list通过VIM编辑器查看,源地址没错,为什么更新的时候去找了清华源呢?
See http://help.ubuntu /community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://cn.archive.ubuntu /ubuntu bionic main restricted # deb-src http://cn.archive.ubuntu /ubuntu bionic main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://cn.archive.ubuntu /ubuntu bionic-updates main restricted # deb-src http://cn.archive.ubuntu /ubuntu bionic-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 /ubuntu bionic universe # deb-src http://cn.archive.ubuntu /ubuntu bionic universe deb http://cn.archive.ubuntu /ubuntu bionic-updates universe # deb-src http://cn.archive.ubuntu /ubuntu bionic-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 /ubuntu bionic multiverse # deb-src http://cn.archive.ubuntu /ubuntu bionic multiverse deb http://cn.archive.ubuntu /ubuntu bionic-updates multiverse # deb-src http://cn.archive.ubuntu /ubuntu bionic-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 /ubuntu bionic-backports main restricted universe multiverse # deb-src http://cn.archive.ubuntu /ubuntu bionic-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 /ubuntu bionic partner # deb-src http://archive.canonical /ubuntu bionic partner deb http://cn.archive.ubuntu /ubuntu bionic-security main restricted # deb-src http://cn.archive.ubuntu /ubuntu bionic-security main restricted deb http://cn.archive.ubuntu /ubuntu bionic-security universe # deb-src http://cn.archive.ubuntu /ubuntu bionic-security universe deb http://cn.archive.ubuntu /ubuntu bionic-security multiverse # deb-src http://cn.archive.ubuntu /ubuntu bionic-security multiverse cn.archive.ubuntu 已经自动跳转到清华镜像站带着很多问号,在浏览器打开http://cn.archive.ubuntu ,发现网站已经自动跳转到清华镜像站了。 以为网站需要https打开,发现该网站无法打开。 有知道原因的小伙伴吗?希望大家不吝分享。
Ubuntu变更镜像源地址虽然访问http://cn.archiv.ubuntu 会自动跳转到清华源,但是我们还是做一个镜像源地址变更。 使用如下命令将镜像文件中的cn.archive.ubuntu 批量更换为清华源。
备份原文件变更前记得备份原始的/ etc / apt / sources.list文件
$sudo cp / etc / apt / sources.list / etc / apt / sources.list.bak 批量在VIM中变更在vim编辑器批量变更字符串,方法如下,按下esc后,输入:
:%s/cn\.archive\.ubuntu\ /mirrors\.tuna\.tsinghua\.edu\ /g第一次替换时,少打了一个“.”报错提示:E486: Pattern not found。这个报错时指没有找到特定的字符,重新检查错误后,发现"."在正则表达式中通常是特殊字符,所以需要使用\ 来转义它,以确保准确匹配点号。所以, .csdn.net 转换后,应该时 .csdn.net。这也算是一个语法上的注意事项。
Ubuntu国内镜像站推荐除了官方的cn.archive.ubuntu 外,国内还有多个Ubuntu的稳定镜像站:
清华大学开源软件镜像站: mirrors.tuna.tsinghua.edu /ubuntu/ 阿里巴巴开源镜像站: mirrors.aliyun /ubuntu/ Ubuntu官方镜像站: http://archive.ubuntu /ubuntu/当然还有一些其他的,以上三个是我个人觉得比较好用的。上文希望对大家有所帮助。
推荐阅读 Ubuntu快速搭建内网NTP Server易记笔记-Ubuntu 下【netstat】指令全解Ubuntu 20.04安装SQL Server易记笔记-Ubuntu升级软件包及注意事项易记笔记-Ubuntu系统时间更改易记笔记-Ubuntu 下【netstat】指令全解ubuntu安装DHCP 服务和排错教程Ubuntu 多路径服务报错处理方法Ubuntu Samba高危安全漏洞修复Windows 11安装Ubuntu 实战教程Ubuntu镜像源cn.arichinve.ubuntu.com不可用原因分析和解决由讯客互联其他栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“Ubuntu镜像源cn.arichinve.ubuntu.com不可用原因分析和解决”