在 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

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

 

 

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