zoukankan      html  css  js  c++  java
  • WSL 部署记录

    1. 管理员打开PowerShell,开启WSL功能:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    2. 应用商店下载安装ubuntu

      默认工作路径:

    C:UsersabnkAppDataLocalPackagesCanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgscLocalState
    ootfs

      Ubuntu中由apt-get获得的文件包保存在:

    /var/cache/apt/archives

    3. VMWare和Hyper-v冲突的解决:

    bcdedit /set hypervisorlaunchtype off

      重启或手动停止Hyper-v服务

    bcdedit /set hypervisorlaunchtype auto

      用VM就关,用Hyper-v就开

    4. 更改源:

      参考

    sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
    # sudo vim /etc/apt/sources.list

      修改:

    # :%s#security.ubuntu.com#mirrors.tuna.tsinghua.edu.cn#g
    # :%s#archive.ubuntu.com#mirrors.tuna.tsinghua.edu.cn#g
    # :%s#cn.mirrors.tuna.tsinghua.edu.cn#mirrors.tuna.tsinghua.edu.cn#g

    # 18,20版本就用下面的就OK :
    %s#archive.ubuntu.com#mirrors.tuna.tsinghua.edu.cn#g

    # 一行命令搞定
    sed -i "s#archive.ubuntu.com#mirrors.tuna.tsinghua.edu.cn#g"  /etc/apt/sources.list
    # 对于CentOS,更改源先yum update, 然后 yum grouplist 再安装
    sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://mirror.centos.org|baseurl=https://mirrors.tuna.tsinghua.edu.cn|g' -i.bak /etc/yum.repos.d/CentOS-*.repo

      其它:

    sudo mv /etc/yum.repos.d/CentOS-Local.repo /etc/yum.repos.d/CentOS-Local.repo_bak
    yum clean all && yum makecache

      生效:

    sudo apt update

    5. 安装gcc、g++

      参考

    sudo apt-get install build-essential
    sudo apt install gcc g++           # 不要用这个了

      以下内容将被安装:

    The following NEW packages will be installed:
      binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-9 dpkg-dev fakeroot g++ g++-9 gcc gcc-9
      gcc-9-base libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5 libatomic1 libbinutils
      libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdpkg-perl libfakeroot libfile-fcntllock-perl
      libgcc-9-dev libgomp1 libisl22 libitm1 liblsan0 libmpc3 libquadmath0 libstdc++-9-dev libtsan0 libubsan1
      linux-libc-dev make manpages-dev
    Log

    6. 升级WSL2

      参考

      powershell开启管理员权限:

    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    lsb_release -a # wsl内查看版本号
  • 相关阅读:
    Android Design Support Library(三)用CoordinatorLayout实现Toolbar隐藏和折叠
    Android Design Support Library(二)用NavigationView实现抽屉菜单界面
    Android Design Support Library(一)用TabLayout实现类似网易选项卡动态滑动效果
    Android5.x Notification应用解析
    了解ViewFlipper工作机制
    OkHttp自定义重试次数
    OkHttp实现全局过期token自动刷新
    Android5.0新控件
    Android4.0新控件
    用typedef给结构体一个别名
  • 原文地址:https://www.cnblogs.com/abnk/p/11298271.html
Copyright © 2011-2022 走看看