zoukankan      html  css  js  c++  java
  • wsl安装Ubuntu16.04+Python2.7

    准备

    因开发需要Ubuntu 16.04 LTS + python 2.7环境
    Store只有18和20未见16 (此方法同样适用于没有商店的LTSB/C发行版)
    根据微软文档,需要手动下载安装Ubuntu 16.04 LTS
    安装前需要在appwiz.cpl中启用WSL功能

    安装

    任意路径打开PowerShell输入以下命令,大约200M等待下载

    PS C:UsersAzure> Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing
    # Downloading...
    PS C:UsersAzure> Add-AppxPackage .Ubuntu.appx
    

    完成安装后会设置UNIX账号密码即可使用

    换源

    众所周知,国内想要偷税的get还得换阿里源
    打开wsl终端,先备份后替换

    $ cd /etc/apt
    $ sudo mv sources.list sources.list.bak
    $ sudo nano sources.list
    

    粘贴如下信息, Ctrl+X保存退出

    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
    ##测试版源  
    deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
    

    之后使用sudo apt update更新一下,就可以愉快的get了

    (如遇抽风,试试清华源)

    # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
    deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
    

    环境

    Ubuntu16.04 LTS系统自带python 3.5,需手动安装2.7

    $ sudo apt install python
    

    参考

    手动下载适用于 Linux 的 Windows 子系统发行版包

  • 相关阅读:
    工程结构
    生活决策
    工作原则概要与列表
    生活原则概要与列表
    在Windows2008下安装SQL Server 2005无法启动服务的解决办法
    MySQL启动提示High Severity Error解决方案
    知乎页面颜色个性化修改
    博客园 CodingLife 模板 翻页样式美化方法
    【翻译】GitHub Pages Basics 基本使用帮助【一】GitHub Pages 是什么?
    【翻译】GitHub Pages Basics 基本使用帮助【首页】
  • 原文地址:https://www.cnblogs.com/azureology/p/12896758.html
Copyright © 2011-2022 走看看