Win10 子系统 Linux 切换国内数据源

本文详细介绍如何在Ubuntu系统中更换软件源至阿里云国内镜像站点,解决因默认仓库在国外导致的网络问题和资源下载不完整的问题。通过编辑sources.list文件并更新apt-get配置,实现更快更稳定的软件包管理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在 Ubuntu 下通过 apt-get 命令很方便的安装 / 卸载软件。由于默认的软件包仓库位于国外,安装软件时就可能遇到各种网络问题或者下载到的一些资源不完整,因此需要切换数据源为国内的镜像站。

1、root 权限编辑数据源配置文件 vim /etc/apt/sources.list 内容为

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

       ggdG 删除全部内容命令,Ins,编辑模式,鼠标右键黏贴剪贴板内容;Esc,:wq 保存。

2、用命令 apt-get update 更新配置即可,这个过程需要一些时间。

 

另:

文件地址:C:\Users\Administrator\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

 

 

windows 的磁盘被挂载在 /mnt 下,可以直接访问

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值