windows安装sublinux全程记录

本文详细介绍了如何在Ubuntu22.04上安装和配置子系统,包括解决WslRegisterDistribution错误、使用阿里云镜像源、设置Pythonpip源、安装SSH服务及生成密钥对以实现无密码远程登录。
部署运行你感兴趣的模型镜像

1、ubuntu子系统安装

2、可能出现的错误

WslRegisterDistribution failed with error: 0x800701bc #5393
解决办法:go to Manual installation steps for older versions of WSL | Microsoft Learn.
then download and install the Linux kernel update package
下载安装之后,就可以正常启动ubutnu了。

3、配置国内的源

注意我这里使用的ubuntu22.04,你需要根据自己安装的ubuntu版本选择对应的源。

编辑/etc/apt/sources.list  sudo vim /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
 

4、更新系统

sudo apt-get update
sudo apt-get upgrade

5、更换python pip源

替换源, 在主文件夹下创建.pip/pip.conf,写入如下内容

[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn

安装pip3

sudo apt-get install pip3

安装虚拟环境

pip install virtualenv

6、安装ssh-server

安装sudo apt-get install openssh-server

配置ssh开机启动

/etc/profile添加

sudo service ssh start

但是这样开机需要输入密码,要想不输入密码增加如下配置

sudo visudo

%sudo ALL=NOPASSWD: /usr/sbin/service ssh start

7、生成密钥对

ssh-keygen
三下回车

8、配置ssh远程登录
复制需要远程连接到此linux的主机的公钥到authorized_keys文件中

OVER

您可能感兴趣的与本文相关的镜像

Python3.8

Python3.8

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值