修改Ubuntu的镜像源为阿里云镜像源

修改Ubuntu的镜像源为阿里云镜像源

复制代码
1、首先使用以下命令备份现有的镜像源:
复制代码
cd /etc/apt
sudo cp sources.list sources.list.bak   
复制代码
2、使用以下命令打开镜像源文件:
复制代码
sudo vim /etc/apt/sources.list  
复制代码
3、在vim插入模式下使用以下内容替换掉原镜像源文件sources.list中的内容:
复制代码
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe  multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
复制代码
4、保存并退出。
复制代码
5、在ubuntu能正常上网的前提下,使用以下命令更新软件列表:
复制代码
sudo apt-get update
sudo apt-get upgrade
复制代码
经过以上流程,ubuntu使用的镜像源就是阿里云的镜像源了。
相关推荐
三体世界42 分钟前
TCP传输控制层协议深入理解
linux·服务器·开发语言·网络·c++·网络协议·tcp/ip
x县豆瓣酱1 小时前
ubuntu server配置静态IP
linux·运维·ubuntu
工藤新一¹1 小时前
Linux
linux·运维·服务器
骇客野人1 小时前
阿里云和腾讯云RocketMQ 发消息和消费消息客户端JAVA接口
阿里云·java-rocketmq·腾讯云
Trust yourself2431 小时前
使用阿里云/腾讯云安装完成mysql使用不了
mysql·阿里云·腾讯云
攀小黑1 小时前
阿里云 使用TST Token发送模板短信
java·阿里云
运维成长记1 小时前
阿里云错题集分享
阿里云·云计算
云资源服务商1 小时前
探秘阿里云消息队列:解锁分布式系统的异步通信奥秘
阿里云·中间件·云计算
bennybi1 小时前
阿里云-跨账号同步OSS Bucket
阿里云·云计算
互联网搬砖老肖1 小时前
运维打铁: 阿里云 ECS 实例的高效运维与管理
运维·阿里云·云计算