win10下linux常用命令
1、wsl2条件下使用图形化界面
安装VcXsrv Windows X Server
https://techcommunity.microsoft.com/t5/windows-dev-appconsult/running-wsl-gui-apps-on-windows-10/ba-p/1493242
https://sourceforge.net/projects/vcxsrv/
每次都需要在win10上打开xming,设置not access control
设置命令
export DISPLAY="`grep nameserver /etc/resolv.conf | sed 's/nameserver //'`:0"
最好写入~/.bashrc避免每次都输入该命令
2、给debian10更换apt源
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
3、给pip更换国内源
mkdir ~/.pip
cd ~/.pip
新建pip.conf,输入下面内容
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=https://pypi.tuna.tsinghua.edu.cn
启用清华的pip源
4、安装gedit
sudo apt install gedit
然后就可以使用gedit了
5、安装firefox
sudo apt install firefox-esr
6、安装xfce,xrdp
sudo apt install xfce4
sudo apt install xrdp
查看ip
ip addr
查看xrdp运行状态
sudo service xrdp status
如果没有运行需要开启
sudo service xrdp start
然后可以通过win10的远程控制台访问wsl2的linux系统界面(需要输入刚才获取的ip)
7、给wsl设置代理,加快下载速度(前提时本地已开启代理软件)
export http_proxy=http://127.0.0.1:1080
export https_proxy=http://127.0.0.1:1080
8、安装字典
sudo apt-get install dict dictd dict-gcide dict-moby-thesaurus
$ git clone https://github.com/ChestnutHeng/Wudao-dict/
或者https://gitee.com/mirrors/wudao-dict.git
$ cd ./wudao-dict/wudao-dict
$ sudo sh setup.sh
9、解决通过xming运行gui程序时提示如下错误
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
解决方法是安装驱动:
sudo apt install libnvidia-gl-440