说明:win10 intel芯片笔记本
powershell 命令
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
powershell 命令
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
linux内核更新包,下载安装
powershell 命令
wsl --set-default-version 2
Ubuntu16.04发行版
在上一步下载下来的ubuntu16.04包的文件夹内 shift按住再鼠标右键打开powershell
powershell 命令
Add-AppxPackage .\wsl-ubuntu-1604
注:此处的 .\wsl-ubuntu-1604 是下载下来的文件名 写的时候最好tab补全
略
powershell命令
C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps\ubuntu2004.exe config --default-user root
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo vim /etc/apt/sources.list
下面的源去覆盖掉上面的源
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
注:vim命令 esc按键为了进命令模式
esc + ggdG(全删)
esc + :wq(保存退出)
esc + :q!(强行退出)
# 安装中文基础语言包
sudo apt install language-pack-zh-hans
# 安装中文桌面语言包
sudo apt install language-pack-gnome-zh-hans
sudo apt install language-pack-kde-zh-hans
# 安装中文手册页(man命令)
sudo apt install manpages-zh
sudo vi /etc/locale.gen
找到 zh_CN.UTF-8 UTF-8 并取消注释,然后保存并退出
locale.gen...
# zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
# zh_HK BIG5-HKSCS
...
sudo locale-gen
sudo vi /etc/default/locale
将内容修改为
localeLANG=zh_CN.UTF-8
注:我的笔记本有核显和独显
英伟达 cuda
英特尔驱动
powershell命令
wsl --update
然后重启
wsl --shutdown
sudo apt install gedit -y
sudo apt install gimp -y
sudo apt install nautilus -y
sudo apt install vlc -y
sudo apt install x11-apps -y
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
添加密钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
更新源
sudo apt update
sudo apt install ros-kinetic-desktop-full
注:使用本地文件去初始化更新ros
找一个地方去下载repo
使用用户名(liuliyang)目录
git clone https://github.com/ros/rosdistro.git
下载下来的文件夹地址如下
\\wsl.localhost\Ubuntu-16.04\home\liuliyang\rosdistro
修改这个下载下来的包中\\wsl.localhost\Ubuntu-16.04\home\liuliyang\rosdistro\rosdep\source.list.d\
下的文件20-default.list
# os-specific listings first
yaml file:///home/liuliyang/rosdistro/rosdep/osx-homebrew.yaml osx
# generic
yaml file:///home/liuliyang/rosdistro//rosdep/base.yaml
yaml file:///home/liuliyang/rosdistro//rosdep/python.yaml
yaml file:///home/liuliyang/rosdistro//rosdep/ruby.yaml
gbpdistro file:///home/liuliyang/rosdistro//releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
修改/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py
中,这个部分
# default file to download with 'init' command in order to bootstrap
# rosdep
DEFAULT_SOURCES_LIST_URL = 'file:///home/liuliyang/rosdistro/rosdep/sources.list.d/20-default.list'
# seconds to wait before aborting download of rosdep data
继续修改
/usr/lib/python2.7/dist-packages/rosdep2/rep3.py
# location of targets file for processing gbpdistro files
REP3_TARGETS_URL = 'file:///home/liuliyang/rosdistro/releases/targets.yaml'
# seconds to wait before aborting download of gbpdistro data
/usr/lib/python2.7/dist-packages/rosdistro/init.py
# index information
DEFAULT_INDEX_URL = 'file:///home/liuliyang/rosdistro/index-v4.yaml'
def get_index_url():
然后初始化
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
roscore
海龟
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key