修改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使用的镜像源就是阿里云的镜像源了。
相关推荐
子正23 分钟前
一键编译包含多个独立模块和应用的工程(linux cmake)
linux·运维·cmake
小阳睡不醒25 分钟前
小白成长之路-Linux Shell脚本练习
linux·运维·服务器
dessler1 小时前
代理服务器-LVS的DR模式
linux·运维·云计算
梦星辰.2 小时前
VSCode CUDA C++进行Linux远程开发
linux·c++·vscode
远方16092 小时前
0x-2-Oracle Linux 9上安装JDK配置环境变量
java·linux·oracle
cui_win2 小时前
每日一令:Linux 极简通关指南 - 汇总
linux·运维·服务器
知星小度S3 小时前
Linux权限探秘:驾驭权限模型,筑牢系统安全
linux·运维·服务器
黄交大彭于晏3 小时前
发送文件脚本源码版本
java·linux·windows
搞Linux的杰仔3 小时前
Ubuntu20.04基础配置安装——系统安装(一)
linux·嵌入式开发
Kaede65 小时前
如何应对Linux云服务器磁盘空间不足的情况
linux·运维·服务器