修改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使用的镜像源就是阿里云的镜像源了。
相关推荐
Tipriest_11 小时前
linux中的文本分接流tee命令介绍
linux·服务器·数据库
阿拉伯柠檬11 小时前
MySQL内置函数
linux·数据库·mysql·面试
Xの哲學12 小时前
Linux CFS 调度器深度解析
linux·服务器·算法·架构·边缘计算
大聪明-PLUS12 小时前
关于 systemd 和桌面应用程序自动启动
linux·嵌入式·arm·smarc
松涛和鸣12 小时前
DAY42 SQLite3 : Dictionary Import and Data Query Implementation with C Language
linux·c语言·数据库·单片机·网络协议·sqlite
小馬佩德罗12 小时前
如何将x264 x265的动态库编译入Linux系统中的FFmpeg源码 - x265库编译
linux·ffmpeg·x265
飞Link13 小时前
【Anaconda】Linux(CentOS7)下安装Anaconda教程
linux·运维·python
DigitalOcean13 小时前
Ubuntu/Debian VPS 上 Apache Web 服务器的完整配置教程
ubuntu·apache
@时间旅行者@13 小时前
LINUX离线安装postgres,rpm方式安装
linux·运维·服务器·postgresql·离线安装
whlqjn_121113 小时前
Ubuntu 20.04图形界面卸载
linux·运维·ubuntu