配置KylinV10
文章目录
设置“root”登录密码
sudo su -
passwd
# 设置登录密码
允许“root”远程登录
配置以使得可以使用MobaXterm连接虚拟机。
sudo vim /etc/ssh/sshd_config
sshd_config
# ↓↓↓↓修改的内容↓↓↓↓
PermitRootLogin yes
# ↑↑↑↑修改的内容↑↑↑↑
sudo systemctl restart sshd
允许通过图像界面登录到“root”
sudo vim /usr/share/lightdm/lightdm.conf.d/95-ukui-greeter.conf
95-ukui-greeter.conf
greeter-session=ukui-greeter
user-session=ukui
greeter-setup-script=/usr/lib/ukui-greeter/ukui-greeter-nm-start.sh
# ↓↓↓↓追加的内容↓↓↓↓
allow-guest=false
greeter-show-manual-login=true
# ↑↑↑↑追加的内容↑↑↑↑
开机自动登录到“root”
sudo vim /etc/lightdm/lightdm.conf
lightdm.conf
[SeatDefaults]
autologin-guest=false
# ↓↓↓↓修改的内容↓↓↓↓
autologin-user=root
# ↑↑↑↑修改的内容↑↑↑↑
autologin-user-timeout=0
关闭“麒麟安全授权认证”
sudo vim /etc/default/grub
grub
# ...
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_DISTRIBUTOR_RELEASE=`lsb_release -d -s | awk -F" " '{print $2 " " $3}' 2> /dev/null || echo ""`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# ↓↓↓↓修改的内容↓↓↓↓
# GRUB_CMDLINE_LINUX_SECURITY="audit=0 security=kysec"
GRUB_CMDLINE_LINUX_SECURITY="audit=0 security="
# ↑↑↑↑修改的内容↑↑↑↑
# ...
# 应用配置
sudo update-grub
# 重启系统
sudo reboot
关闭自动睡眠
挂载“Windows”下共享目录到虚拟机
# 配置
SHARE_REMOTE_PATH=//192.168.2.10/F
SHARE_REMOTE_USR=smb
SHARE_REMOTE_PWD=smb
SHARE_LOCAL_PATH=/mnt/f
# 挂载
mkdir ${SHARE_LOCAL_PATH}
sudo mount -t cifs ${SHARE_REMOTE_PATH} ${SHARE_LOCAL_PATH} -o user=${SHARE_REMOTE_USR},password=${SHARE_REMOTE_PWD},iocharset=utf8,dir_mode=0777,file_mode=0777
# 卸载
# sudo umount ${SHARE_LOCAL_PATH}
安装“Docker”到“KylinV10”
mkdir /tmp/docker
pushd /tmp/docker
# 下载
URL_PREFIX="https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64"
wget "${URL_PREFIX}/containerd.io_1.6.9-1_amd64.deb"
wget "${URL_PREFIX}/docker-ce-cli_20.10.9~3-0~debian-buster_amd64.deb"
wget "${URL_PREFIX}/docker-ce_20.10.9~3-0~debian-buster_amd64.deb"
# 安装
dpkg -i ./*.deb
# 删除下载缓存
popd
rm -rf /tmp/docker
# 测试安装
docker images
配置拉取镜像
# 镜像加速服务(Registry Mirrors)
sudo mkdir -p /etc/docker
echo '{"registry-mirrors":["https://docker.mirrors.ustc.edu.cn"]}' | \
sudo tee /etc/docker/daemon.json > /dev/null
head /etc/docker/daemon.json
# 重启应用镜像
sudo systemctl daemon-reload
sudo systemctl restart docker
# Or
sudo service docker restart
# 查看镜像
sudo docker info 2> /dev/null | grep 'Registry Mirrors' -A1
常用数据库
docker pull mysql:5.7-debian
docker pull mysql:8.0-debian
# 启用
docker run -d --rm --name db \
-p 3306:3306 \
-v /var/lib/mysql:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=root \
mysql:8.0-debian
# 测试
apt install mysql-client
mysql -h 127.0.0.1 -uroot -p
B/S
安装“Maven-3.6.3”
apt install maven
mvn --version
安装“Gradle-4.4.1”
apt install gradle
安装“Jdk-8”
# jdk-8
apt install openjdk-8-jdk
安装“Jdk-11”
# jdk-11
apt install openjdk-11-jdk
安装“Jdk-17”
apt
源仅提供了jdk-8
和jdk-11
,jdk-17
需要从Oracle-JDK-17下载。
mkdir /tmp/jdk
pushd /tmp/jdk
# 下载方法1(速度较慢)
wget https://download.oracle.com/java/17/archive/jdk-17.0.7_linux-x64_bin.deb
# 下载方法2(多线程下载)
# apt install aria2
aria2c -k 1M -x 16 -j 5 https://download.oracle.com/java/17/archive/jdk-17.0.7_linux-x64_bin.deb
# 安装
apt install libc6-x32
dpkg -i ./*.deb
# 删除下载缓存
popd
rm -rf /tmp/jdk
# 测试安装
JAVA_HOME=/lib/jvm/jdk-17
${JAVA_HOME}/bin/java --version
安装“Nodejs-10.19.0”
apt install nodejs
安装“Nodejs-18”
apt
源仅提供了10.19.0
版本,其余版本需从nodejs官网下载。
mkdir /tmp/nodejs
pushd /tmp/nodejs
# 下载
wget https://nodejs.org/dist/v18.16.0/node-v18.16.0-linux-x64.tar.xz
# 安装
tar -xvf node-v18.16.0-linux-x64.tar.xz
cp -r node-v18.16.0-linux-x64/* /usr/local/
# 删除下载缓存
popd
rm -rf /tmp/nodejs
# 测试安装
node -v
npm -v
安装“IntelliJ IDEA-2022.2.1”
mkdir /tmp/idea
pushd /tmp/idea
# 下载(多线程下载)
# apt install aria2
aria2c -k 1M -x 16 -j 5 https://download.jetbrains.com/idea/ideaIU-2022.2.1.tar.gz
# 安装
tar -xvf ideaIU-2022.2.1.tar.gz -C /usr/local
# 删除下载缓存
popd
rm -rf /tmp/idea
创建桌面快速启动:
IntelliJ IDEA.desktop
[Desktop Entry]
Name=IntelliJ IDEA
GenericName=IntelliJ IDEA
Comment=IntelliJ IDEA
Icon=/usr/local/idea-IU-222.3739.54/bin/idea.png
Exec=/usr/local/idea-IU-222.3739.54/bin/idea.sh
Terminal=false
Type=Application
Categories=IDE;
StartupNotify=true
激活软件:
略
C/S
apt
源已满足要求。
安装“Ninja-1.10.0”
apt install ninja-build
安装“CMake-3.16.3”
apt install cmake
安装“Qt-5.12.8”
apt install qt5-default qtcreator
安装“CLion-2022.2.1”
mkdir /tmp/clion
pushd /tmp/clion
# 下载(多线程下载)
# apt install aria2
aria2c -k 1M -x 16 -j 5 https://download.jetbrains.com/cpp/CLion-2022.2.1.tar.gz
# 安装
tar -xvf CLion-2022.2.1.tar.gz -C /usr/local
# 删除下载缓存
popd
rm -rf /tmp/clion
创建桌面快速启动:
CLion.desktop
[Desktop Entry]
Name=CLion
GenericName=CLion
Comment=CLion
Icon=/usr/local/clion-2022.2.1/bin/clion.png
Exec=/usr/local/clion-2022.2.1/bin/clion.sh
Terminal=false
Type=Application
Categories=IDE;
StartupNotify=true
激活软件:
略