zoukankan      html  css  js  c++  java
  • windows10环境下安装Linux子系统---debian

    一、前提

    1、在控制面板-程序-启用与关闭Windows功能中,勾选“适用于Linux的Windows子系统”

     2、首先需要创建一个文件夹,用来存放子系统,在需要的位置创建即可,文件夹名任意

    3、手动下载Windows子系统发行版包,下载完需要的发行版包后,将后缀名为.appx的文件放至上一步中的目录

    下载地址: https://docs.microsoft.com/zh-cn/windows/wsl/install-manual

    二、安装

    1、双击压缩包安装即可

    三、移动(本人电脑C盘满了,不需要将子系统移动的,可以跳过这个)

    1、在安装子系统之前,我们需要下载一个东西 -> LxRunOffline  下载地址 (https://github.com/DDoSolitary/LxRunOffline/releases)

        下载文件LxRunOffline-vxxxx.zip  然后解压到某个一个目录中,之后我们需要设置环境变量,使用这个东西去移动我们的子系统,所以不可以删除这个东西

        右击”此电脑“->属性->高级系统设置,在高级面板中选择环境变量。选择系统变量中的Path变量,点击编辑按钮。

        点击新建,并把刚刚LxRunOffline的解压地址粘贴到新的项目中。切记这个目录里必须包含LxRunOffline.exe文件

        然后重启电脑,打开命令行工具,输入LxRunOffline,如果显示下面的提示证明已经安装成功了

    2、打开命令行,输入LxRunOffline list 查看我们的子系统版本,我安装的是ubuntu18.04,例如显示这样的界面

        移动命令: LxRunOffline move -n Ubuntu-18.04 -d D:WinLinux  

    3、移动Debian的指令

    LxRunOffline list
    LxRunOffline move -n Debian -d D:Debian

    四、windows商店中下载windows terminal

        安装这个的目的是Debian可以轻松访问电脑中其他磁盘

    五、配置Debian镜像源

    1、Debian系的源一般都是由下列文件提供

    /etc/apt/sources.list

    2、所以可以使用的方法有两个

    • 第一个就是只替换域名
    • 第二个则是全替换

    3、替换域名

    sed -i 's#http://deb.debian.org#https://mirrors.ustc.edu.cn#g' /etc/apt/sources.list

        手动替换也行:

        (1)由于用vi文本编辑器特别别扭,我先连上梯子,先更新apt包

    apt update

        (2)安装vim编辑器

    apt install vim

        (3)修改/etc/apt/sources.list文件,将里边的有关debian的根htpp地址替换成中科大的镜像地址:mirrors.ustc.edu.cn

            替换后如下图所示,替换后还要执行:apt update

    4、更新

    apt update

    5、各个源

    163镜像站  

    1. deb http://mirrors.163.com/debian/ buster main non-free contrib
    2. deb http://mirrors.163.com/debian/ buster-updates main non-free contrib
    3. deb http://mirrors.163.com/debian/ buster-backports main non-free contrib
    4. deb http://mirrors.163.com/debian-security/ buster/updates main non-free contrib
    5.  
    6. deb-src http://mirrors.163.com/debian/ buster main non-free contrib
    7. deb-src http://mirrors.163.com/debian/ buster-updates main non-free contrib
    8. deb-src http://mirrors.163.com/debian/ buster-backports main non-free contrib
    9. deb-src http://mirrors.163.com/debian-security/ buster/updates main non-free contrib

    华为云镜像站

    1. deb https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
    2. deb https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
    3. deb https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free
    4. deb https://mirrors.huaweicloud.com/debian-security/ buster/updates main contrib non-free
    5.  
    6. deb-src https://mirrors.huaweicloud.com/debian/ buster main contrib non-free
    7. deb-src https://mirrors.huaweicloud.com/debian/ buster-updates main contrib non-free
    8. deb-src https://mirrors.huaweicloud.com/debian/ buster-backports main contrib non-free

    腾讯云镜像站

    1. deb http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
    2. deb http://mirrors.cloud.tencent.com/debian-security buster/updates main
    3. deb http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
    4. deb http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib
    5.  
    6. deb-src http://mirrors.cloud.tencent.com/debian-security buster/updates main
    7. deb-src http://mirrors.cloud.tencent.com/debian/ buster main non-free contrib
    8. deb-src http://mirrors.cloud.tencent.com/debian/ buster-updates main non-free contrib
    9. deb-src http://mirrors.cloud.tencent.com/debian/ buster-backports main non-free contrib

    中科大镜像站

    1. deb https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
    2. deb https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
    3. deb https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
    4. deb https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
    5.  
    6. deb-src https://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
    7. deb-src https://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
    8. deb-src https://mirrors.ustc.edu.cn/debian/ buster-backports main contrib non-free
    9. deb-src https://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free

    阿里云镜像站

    1. deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
    2. deb http://mirrors.aliyun.com/debian-security buster/updates main
    3. deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
    4. deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
    5.  
    6. deb-src http://mirrors.aliyun.com/debian-security buster/updates main
    7. deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
    8. deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
    9. deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

    清华大学镜像站

    1. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
    2. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
    3. deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
    4. deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
    5.  
    6. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
    7. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
    8. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
    9. deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free

    兰州大学镜像站

    1. deb http://mirror.lzu.edu.cn/debian stable main contrib non-free
    2. deb http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
    3. deb http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
    4. deb http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free
    5.  
    6. deb-src http://mirror.lzu.edu.cn/debian stable main contrib non-free
    7. deb-src http://mirror.lzu.edu.cn/debian stable-updates main contrib non-free
    8. deb-src http://mirror.lzu.edu.cn/debian/ buster-backports main contrib non-free
    9. deb-src http://mirror.lzu.edu.cn/debian-security/ buster/updates main contrib non-free

    上海交大镜像站

    1. deb https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
    2. deb https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
    3. deb https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
    4. deb https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free
    5.  
    6. deb-src https://mirror.sjtu.edu.cn/debian/ buster-updates main contrib non-free
    7. deb-src https://mirror.sjtu.edu.cn/debian/ buster-backports main contrib non-free
    8. deb-src https://mirror.sjtu.edu.cn/debian/ buster main contrib non-free
    9. deb-src https://mirror.sjtu.edu.cn/debian-security/ buster/updates main contrib non-free
  • 相关阅读:
    select,epoll,poll比较(网络资源总结)
    c++(重载、覆盖、隐藏)
    TCP状态转换图
    TCP心跳 | TCP keepAlive
    回车、换行、空格的ASCII码值—(附ASCII码表)
    C++ dlopen mini HOWTO 一篇非常好的介绍
    shell十三问
    linux IPC消息队列 的内核限制
    C++ string 类常用函数
    const用法的解惑
  • 原文地址:https://www.cnblogs.com/zhangxianrong/p/14043865.html
Copyright © 2011-2022 走看看