WSL2 ubuntu子系统换源

文章目录

1.直接编辑/etc/apt/sources.list文件(需要使用 sudo):

将原文件做备份:

复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources_copy.list

编辑文件

复制代码
sudo vi /etc/apt/sources.list

2.将文件中的内容删除,将以下对应版本镜像源复制到里面。

ubuntu的镜像源

ubuntu18.04(bionic)配置如下:

复制代码
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

# deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src 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-backports main restricted universe multiverse

ubuntu 20.04(focal) 配置如下:

复制代码
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

3.更新

复制代码
sudo apt-get update
相关推荐
wanhengidc10 分钟前
跨境电商为什么依赖于云手机
运维·服务器·游戏·智能手机·云计算
翼龙云_cloud14 分钟前
亚马逊云渠道商:aws安全组没有加ip用ip访问会有什么问题?
运维·tcp/ip·安全·云计算·aws
@菜菜_达1 小时前
Nginx错误拦截转发 error_page
运维·nginx
云计算老刘1 小时前
10. Linux 系统启动原理
linux·运维·服务器
h***93661 小时前
【MySQL数据库】Ubuntu下的mysql
数据库·mysql·ubuntu
CS_浮鱼1 小时前
【Linux编程】线程同步与互斥
linux·网络·c++
任聪聪2 小时前
Centos平替系统RockyLinux详细安装教程
linux·运维·centos
zjj5873 小时前
ubuntu虚拟内存
linux·运维·ubuntu
Q688238863 小时前
基于Matlab的LMI矩阵理论算法与矩阵不等式研究:待求矩阵在LMI区域内的优化设计与区间观...
ubuntu
终端行者3 小时前
Nginx 配置Websocket代理 Nginx 代理 Websocket
运维·websocket·nginx