win10 wsl ubuntu 更换版本为18.04 apt换国内源Python换国内源;默认root; Ubuntu18.04 下载与安装(阿里云官方镜像站)

控制面板里面应用模块找到Ubuntu,可以卸载或者移动到其他盘。
Microsoft 应用程序 - ubuntu
https://apps.microsoft.com/store/search/ubuntu?hl=zh-cn&gl=cn&rtc=1
选择想要的版本安装。

cp /etc/apt/sources.list /etc/apt/sources.list.bak
nano /etc/apt/sources.list

编辑/etc/apt/sources.list文件, 在文件最前面添加以下条目(操作前请做好相应备份):ubuntu 18.04(bionic) 配置如下

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

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

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

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

deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

然后执行命令:

sudo apt-get update
sudo apt-get upgrade

在命令提示符中运行

apt install python3-pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/

WIN+X,管理员模式打开Powershell,输入如下命令:

C:\Program Files\WindowsApps\CanonicalGroupLimited.Ubuntu18.04LTS_1804.6.4.0_x64__79rhkp1fndgsc> .\ubuntu1804.exe config --default-user root

阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区
https://developer.aliyun.com/mirror/?spm=a2c6h.265751.1364563.38.728e2621iHKW48
选择OS镜像
在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值