修改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使用的镜像源就是阿里云的镜像源了。
相关推荐
无忧.芙桃10 小时前
Linux系统编程(四):用户与权限管理
linux·运维·服务器
戊本菌13 小时前
进程(三)进程优先级:谁先上 CPU
linux·c语言·硬件架构
aningx14 小时前
Arch 系用 greetd 实现开机自动进 Plasma Wayland,注销自动回桌面
linux
江无行者15 小时前
Linux 服务器 top 命令详解
linux
嵌入式 Linux手记17 小时前
一块内存,三种解释:union 的真实用法
linux·c语言·驱动开发·嵌入式
星恒随风17 小时前
MySQL 从零入门(九):事务管理详解——ACID、COMMIT、ROLLBACK、SAVEPOINT 与四种隔离级别
linux·服务器·数据库·笔记·mysql
草莓熊Lotso18 小时前
【C++ 基于微服务的即时通讯系统】ElasticSearch 用户数据管理实现
linux·数据库·c++·elasticsearch·微服务·架构
星恒随风18 小时前
MySQL 从零入门(十一):视图与用户权限管理详解
linux·服务器·数据库·笔记·mysql
江华森20 小时前
从零开始:智能运维概念与Linux环境准备完全指南
linux·运维