Linux笔记(银河麒麟V10)
Linux 下切换 Python 版本
whereis python
rm /usr/bin/python
ln -s /usr/bin/python3.6 /usr/bin/python
测试:
python --version
Python 3.8.2
安装 Node.js-v18
curl https://nodejs.org/dist/v18.17.0/node-v18.17.0-linux-x64.tar.xz --output nodejs18.tar.xz # 下载
tar -xf nodejs18.tar.xz # 解压
mv node-v18.17.0-linux-x64 /usr/lib/ # 移动
rm /usr/bin/node # 删除原node
ln -s /usr/lib/node-v18.17.0-linux-x64/bin/node /usr/bin/node # 创建命令链接
ln -s /usr/lib/node-v18.17.0-linux-x64/bin/npm /usr/bin/npm # 创建npm命令链接
npm install -g npm@latest # 更新npm模块
测试:
node -v
v18.17.0
npm -v
9.6.7
安装 cnpm
npm install -g cnpm # 全局安装cnpm
ln -s /usr/lib/node-v18.17.0-linux-x64/bin/cnpm /usr/bin/cnpm # 创建命令链接
cnpm -v # 测试安装成功
安装 aptitude 和 gcc
apt-get install aptitude
aptitude install gcc
安装 cv2
apt-get install pip # 先安装pip
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python # 使用清华源安装opencv
安装 openssh
apt-get install openssh-server
service ssh stop # 停止服务
service ssh start # 启动服务
service ssh status # 查看服务状态
samba 服务
服务相关
systemctl restart smbd.service # 启动/重启服务
systemctl status smbd # 查看服务状态
vim /etc/samba/smb.conf # 查看配置
samba 用户相关(必须设置 smb 用户,用系统用户是无法访问共享的)
pdbedit –a username # 新建samba用户
设置开机启动
cd /etc/xdg/autostart # 打开/etc/xdg/autostart目录
sudo vim test.desktop # 创建快捷方式并保存
test.desktop 文件内容
[Desktop Entry]
Name = TestApp #可执行文件名字
Exec = /data/Test.AppImage #可执行文件路径
Type = Application #可执行文件类型
浙公网安备 33010602011771号