• wsl相关总结


    • 启用WSL
      VirtualMachinePlatform是WSL2依赖功能,需要系统支持(build 18917+),硬件支持VM功能并开启,安装完成后要重启计算机。
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
    
    • 升级WSL到WSL2
    wsl --set-version ubuntu 2 #设置为1则降级
    wsl --set-default-version 2 #设置默认版本
    wsl -l -v #显示已安装的列表
    
    • 文件读写权限配置
    sudo vim /etc/wsl.conf
    

    添加如下内容

    [automount]
    enabled=true
    root="/mnt/"
    options="metadata,uid=1000,gid=1000,umask=22,fmask=111"
    mountFsTab=true
    [network]
    generateHosts=true
    generateResolvConf=true
    
    • 修改源为阿里云镜像
    sudo vim /etc/apt/sources.list
    #替换成阿里云镜像
    :%s/security.ubuntu/mirrors.aliyun/g
    :%s/archive.ubuntu/mirrors.aliyun/g
    
    sudo apt update && sudo apt upgrade -y
    
    • 关闭git文件模式,解决wsl与windows上一边操作后,另一边git提示有文件修改问题。
    git config core.filemode false
    git config core.autocrlf true #如果windows上也配置了这个选项,则不建议关闭。
    
  • 相关阅读:
    Lyndon Word & The Runs Theorem
    Codeforces 1477F. Nezzar and Chocolate Bars
    Codeforces Round #700 (Div.1)
    kubeadm 安装 k8s
    centos7更新阿里yum源
    CF1186 F. Vus the Cossack and a Graph
    CF1152 D. Neko and Aki's Prank
    CF803 C. Maximal GCD
    CF1180 B. Nick and Array
    CF1186 D. Vus the Cossack and Numbers
  • 原文地址:https://www.cnblogs.com/flying_bat/p/11089167.html
Copyright © 2020-2023  润新知