要开学了,估计更新会更拖延,所以抓紧时间来水一篇更新

快速到达上一篇

无法复制粘贴的情况下更换国内源

以下为废话

众所周知Linux上手后第一件事就是换源和更新软件包,通常我们都是在带有图形桌面(GUI)Linux系统里打开浏览器,并找到合适的国内源,然后用vim复制粘贴来更换,纯命令行的Linux服务器一般是不用换源(厂商定制的镜像中已经换好了)

与虚拟机不同,子系统并不能与主系统共用剪切板(简单来说就是Windows复制的内容不能粘贴到Linux子系统),难不成这么长的软件源我们得手打?
 

正文

——————————————————————————————————————

第一步找到目录

打开子系统
键入explorer.exe . 回车
以运行文件管理程序

这里打开的文件夹为Linux子系统的文件目录,现在我们的权限是755(游客只读),故不能修改

第二步赋权

给当前用户组赋权

sudo  chmod  777  /etc/apt/sources.list

然后输入密码即可

第三步修改

软件源目录地址为/etc/apt/sources.list

文件目录即为\\wsl$\Ubuntu-18.04\etc\apt\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-backports main restricted universe multiverse
##测试版
#deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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-backports main restricted universe multiverse
##测试版
#deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse


# 清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
##测试版
#deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
##测试版
#deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multivers
最后修改:2020 年 06 月 29 日 11 : 09 AM
神楽めあ:我很可爱,请给我钱!