• 企业400电话
  • 网络优化推广
  • AI电话机器人
  • 呼叫中心
  • 全 部 栏 目

    网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    Windows10安装WSL2 Ubuntu20.04并设置docker环境的方法
    POST TIME:2021-10-16 16:51

    启用 WSL

    确定系统为 Windows 10 2004 以后的版本

    右击“菜单”-“设置”-“应用”-“程序和功能”-“启用或关闭Windows功能”

    框选“适用于Linux的Windows子系统”

    重启系统应用设置

    安装 WSL2 Ubuntu 20.04

    启用 WSL2

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    wsl --set-default-version 2

    打开“Microsoft Store”,搜索 Ubuntu20.04,并点击安装


    下载完成之后,从开始菜单启动 Ubuntu 20.04 LTS


    更新软件源并更新

    sudo tee /etc/apt/sources.list << EOF
    deb http://mirrors.163.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ $(lsb_release -cs)-proposed main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic-proposed $(lsb_release -cs) restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic-backports $(lsb_release -cs) restricted universe multiverse
    EOF
    
    sudo apt-get update
    sudo apt-get upgrade -y

    安装 docker

    sudo apt-get install -y apt-transport-https \
    
                ca-certificates \
    
                curl \
    
                gnupg-agent \
    
                software-properties-common
    curl -fsSL https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository \
    
       "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu bionic stable"
    # 目前 20.04 还没有国内清华 docker 源,暂时用 18.04 版本  
    sudo apt-get update
    sudo apt-get install -y docker-ce docker-ce-cli containerd.io
    sudo cp /mnt/c/Windows/Fonts /usr/share/fonts/chinese -r
    cd /usr/share/fonts/chinese
    sudo mkfontscale
    sudo mkfontdir
    fc-cache -fv
    source /etc/profile
    sudo chmod -R 755 *

    安装 zsh

    sudo apt-get install zsh
    sh -c "$(wget -O- https://gitee.com/kingscat/ohmyzsh/raw/master/tools/install.sh)"

    到此这篇关于Windows10安装WSL2 Ubuntu20.04并设置docker环境的方法的文章就介绍到这了,更多相关Windows10安装WSL2 Ubuntu20内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

    上一篇:ubuntu20.04 LTS安装docker的方法步骤
    下一篇:安装Ubuntu 20.04后要做的事(小白教程)
  • 相关文章
  • 

    关于我们 | 付款方式 | 荣誉资质 | 业务提交 | 代理合作


    © 2016-2020 巨人网络通讯

    时间:9:00-21:00 (节假日不休)

    地址:江苏信息产业基地11号楼四层

    《增值电信业务经营许可证》 苏B2-20120278

    X

    截屏,微信识别二维码

    微信号:veteran88

    (点击微信号复制,添加好友)

     打开微信