ubuntu 18.04配置镜像源

发布于:2025-07-05 ⋅ 阅读:(17) ⋅ 点赞:(0)

配置镜像源的主要作用是优化软件下载速度、提升系统更新稳定性,并确保软件包获取的可靠性
我这里配置阿里云镜像源
镜像的具体内容参考此文:
文章链接

以防万一,先备份一下

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

然后开始修改

sudo nano /etc/apt/sources.list

将里面原有的加#全部注释掉
在这里插入图片描述

并复制黏贴参考博文里的镜像内容,我的ubuntu是18.04,对应的镜像是

deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

在这里插入图片描述
然后退出保存

测试一下有无生效

#更新软件列表:
sudo apt update
#检查软件源:
apt policy curl

在这里插入图片描述
配置成功


网站公告

今日签到

点亮在社区的每一天
去签到