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
相关推荐
FlightYe15 分钟前
视界原理之3D视频(三):解码和显示
android·linux·3d·ffmpeg·音视频·android runtime
学页官方17 分钟前
部署实战】教培系统私有化部署全流程:从云服务器到上线验收
运维·服务器
时间售卖铺23 分钟前
MySQL 备份
运维·数据库·mysql·云原生
指艺40 分钟前
VirtualBox安装fedora完成后重启,仍提示安装fedora
运维·服务器
牢姐与蒯1 小时前
Linux网络篇——TCP(一)之手搓TCP,并实现词典和远程命令
linux·网络·tcp/ip
FlightYe1 小时前
linux系统编程(十七):内存管理基础
android·linux·ffmpeg·音视频·android runtime
严同学正在努力1 小时前
PostgreSQL 数据库安装部署教程(Linux 多发行版 + Windows + Docker 全覆盖)
linux·数据库·postgresql
4SAPI1 小时前
电商全链路内容自动化生成大模型 API 生产选型指南:4SAPI、硅基流动与 OpenRouter 的架构权衡
运维·人工智能·架构·自动化·1024程序员节
Leo.yuan1 小时前
数据准备工具进入自动化时代:7款产品的实际使用场景与选择建议
运维·自动化
吴建旭 智宅焕1 小时前
智能家居全国交付模式选型架构设计:连接型与兜底型的决策矩阵与匹配逻辑
运维·智能家居·devops