修改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使用的镜像源就是阿里云的镜像源了。
相关推荐
Fcy6487 分钟前
Linux下 信号的保存与捕捉
linux·中断·信号的捕捉·信号的保存
A_humble_scholar1 小时前
Linux(九) 进程管理完全指南:从入门到实战
linux·运维·chrome
江华森1 小时前
Linux 操作命令完全指南
linux·运维
rjszcb2 小时前
Linux,sensor调试笔记1,修改帧率,以及曝光上不去问题
linux
C++ 老炮儿的技术栈2 小时前
Ubuntu root账号自动登陆
linux·运维·服务器·c语言·c++·ubuntu·visual studio
2301_780789662 小时前
零信任架构中,身份感知防火墙(IAFW)的部署要点与最佳实践
linux·运维·服务器·人工智能·tcp/ip·架构
小狮子&2 小时前
ubuntu2604无法共享文件夹问题解决
linux·运维·服务器
biter down2 小时前
3:VMware Workstation 安装 Ubuntu 22.04 超详细教程
linux·运维·ubuntu
曾阿伦2 小时前
netcat / ncat / socat 用法详解与示例
linux·http·信息与通信
zhping10113 小时前
Ubuntu 登录密码忘记
运维·服务器·ubuntu