统信UOS操作系统(Deepin)前端开发环境配置参考

摘要

如果你准备或正在使用 Deepin 类的系统,或许本文可以给你提供一些参考。最近因工作开发需要拿到了一台华为擎云 L410,其操作系统为统信 UOS 20(Deepin),本文为对该系统配置开发环境的记录。

目录
[隐藏]

最近因工作开发需要拿到了一台华为擎云 L410,其操作系统为统信 UOS 20(Deepin),本文为对该系统配置开发环境的记录。

1 基本配置

1.1 别名设置

# ll 别名命令
echo "alias ll='ls -alh'" >> ~/.bashrc

source ~/.bashrc

1.2 添加 apt-get

apt-get 默认源有许多软件无法安装,我们可以替换为免费的国内源。执行如下命令:

sudo vim /etc/apt/sources.list

在末尾添加如下行(可选择将 chinauos 的源注释掉):

# 清华源
deb [by-hash=force] https://mirrors.tuna.tsinghua.edu.cn/deepin panda main contrib non-free
# 163 源
# deb [by-hash=force] http://mirrors.163.com/deepin lion main contrib non-free
# 阿里云
deb [by-hash=force] http://mirrors.aliyun.com/deepin apricot main contrib non-free
# 中科大
# deb [by-hash=force] https://mirrors.ustc.edu.cn/deepin apricot main contrib non-free

然后执行如下命令更新:

sudo apt-get update
sudo apt-get upgrade

2 软件安装

2.1 应用商店直接安装的应用

直接搜索关键字并安装即可:

  • 微信
  • 企业微信
  • QQ
  • WPS
  • 腾讯会议
  • 飞书
  • Foxmail
  • 讯飞输入法
  • Visual studio code
  • WebStorm
  • Remmina 远程桌面客户端:主要用于远程连接 windows 电脑

2.2 通过 bash shell 命令安装的软件

  • git
  • gcc
  • g++
  • gdb
  • nvm
  • nodejs
  • yarn、pnpm、nrm
  • python2
  • python3
  • mysql
  • docker-ce
# 更新
sudo apt-get update

# 安装 git
sudo apt-get install git

# 安装 gcc、g++、gdb: npm Native 模块使用 node-gyp 编译时会用到
sudo apt -y install gcc g++ gdb

# 安装 nvm
cd ~
git clone --depth 1 https://gh-proxy.com/https://github.com/nvm-sh/nvm ~/.nvm
curl -o- https://gh-proxy.com/https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash

# 设置 nvm 国内镜像源
echo "export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node" >> ~/.bashrc
echo "export NVM_IOJS_ORG_MIRROR=https://npmmirror.com/mirrors/iojs"  >> ~/.bashrc
source ~/.bashrc

# 使用 nvm 安装 nodejs
nvm install 18
# 安装 yarn、pnpm 包管理工具
npm i -g nrm yarn pnpm

其他可选:

# python 2 pip
sudo apt install python-pip
# python 3
sudo apt install python3-venv python3-pip
# 更新 pip3
sudo python3 -m pip install --upgrade pip --force-reinstall

# 配置 `pip` 为国内源(这里选择了清华源,可选择下面任意一个)
# https://mirrors.aliyun.com/pypi/simple/ # 阿里云
# https://pypi.mirrors.ustc.edu.cn/simple/ # 中科大
# https://pypi.douban.com/simple/ # 豆瓣
mkdir ~/.pip/
echo "[global]" >> ~/.pip/pip.conf
echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.pip/pip.conf

# 安装 nginx
sudo apt-get install nginx
nginx -v

# 安装 mysql
sudo apt-get install -y mysql-server mysql-client
sudo mysql_secure_installation
sudo mysql -u root -p

# 设置 mysql 密码为 123456
update mysql.user set plugin="mysql_native_password"
grant all on *.* to root@"localhost"
update mysql.user set authentication_string=password('123456') where user='root'and Host = 'localhost';

# 安装 mysql-workbench:MYSQL官方的可视化管理工具
sudo apt-get install mysql-workbench

# 安装 docker
# 参考:https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/
sudo apt-get install docker-ce

2.3 通过下载安装包手工安装的应用

理论上任意 arm 架构编译的 deb 应用包都可以下载和安装。
deb 包也可以在 bash 命令行中使用 wget 下载并使用 apt 安装。但由于需要确认选择具体的版本,还是逐一下载确认并安装比较适合。

  • NxShell:一个相对轻量开源免费的 SSH 客户端
    • https://github.com/nxshell/nxshell
    • deb 包下载:https://gh-proxy.com/github.com/nxshell/nxshell/releases/download/v1.9.0/NxShell-arm64-linux-1.9.0-202211250312.deb
    • sourceforge 镜像下载:https://sourceforge.net/projects/nxshell/files/v1.9.0/
  • More…

3 其他配置

3.1 git 配置

# 设置默认账号与邮箱
$ git config --global user.name "renxia"
$ git config --global user.email "邮箱"

# 生成 ssh 公私钥
ssh-keygen -t rsa
# 查看公钥(复制并配置至 gitlab、github 等)
cat ~/.ssh/id_rsa.pub

3.2 vscode 支持 code 命令从当前目录打开

# 设置 code 别名,支持 code 命令从当前目录打开 vscode
# 注意:如果是手动从官网下载并安装的,这里去掉路径中的 uos
ls -lh /opt/apps/com.visualstudio.code.uos/files/code/code
echo "alias code='/opt/apps/com.visualstudio.code.uos/files/code/code'" >> ~/.bashrc
source ~/.bashrc

4 小结

不知道是不是我哪里打开的姿势不对。吐槽一下这个桌面环境,延迟感太强烈,跟个玩具一样。不是工作需要真不想用它。

点赞 (1)

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

Captcha Code