zoukankan      html  css  js  c++  java
  • 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上也配置了这个选项,则不建议关闭。
    
  • 相关阅读:
    $.unique()去重问题
    js判断中文
    js URL中文传参乱码
    zabbix添加nginx监控
    TCP/IP与OSI参考模型原理
    100个linux系统常用指令
    read指令使用方法
    grep与正则表达式使用
    shell脚本中case的用法
    shell脚本:变量,文件判断,逻辑运算等纪要
  • 原文地址:https://www.cnblogs.com/flying_bat/p/11089167.html
Copyright © 2011-2022 走看看