步骤一:挂载本地镜像
# mount /dev/sr1 /mnt(补充:这里以挂载 /dev/sr1 到 /mnt 目录为例)
步骤二:添加本地镜里的软件源
# zypper ar file:///mnt/Module-Basesystem local(补充:这里以将 file:///mnt/Module-Basesystem 添加到软件源并命名为 local 为例)
# mount /dev/sr1 /mnt(补充:这里以挂载 /dev/sr1 到 /mnt 目录为例)
# zypper ar file:///mnt/Module-Basesystem local(补充:这里以将 file:///mnt/Module-Basesystem 添加到软件源并命名为 local 为例)
# dnf help# dnf help <option>或者:
# dnf <option> help# dnf install <software># dnf -y install <software>或者:
# dnf install <software> -y# dnf remove <software># dnf -y remove <software>或者:
# dnf remove <software> -y# dnf update <software># dnf -y update <software>或者:
# dnf update <software> -y# dnf update# dnf -y update或者:
# dnf update -y# dnf update --exclude=<software># dnf -y update --exclude=<software>或者:
# dnf update --exclude=<software> -y# dnf check-update# dnf list all | grep <software># dnf info | grep <software># dnf list all# dnf groupinstall <group># dnf -y groupinstall <group>或者:
# dnf groupinstall <group> -y# dnf groupremove <group># dnf -y groupremove <group>或者:
# dnf groupremove <group> -y# dnf group list# dnf update --advisory=<errata># dnf -y update --advisory=<errata>或者:
# dnf update --advisory=<errata> -y# dnf updateinfo <errata># dnf update-minimal --security# dnf -y update-minimal --security或者:
# dnf update-minimal --security -y# dnf updateinfo list# dnf updateinfo info security# dnf update --cve <CVE># dnf -y update --cve <CVE>或者:
# dnf update --cve <CVE> -y# dnf updateinfo list cves# dnf updateinfo info security# dnf update <security patch># dnf -y update <security patch>或者:
# dnf update <security patch> -y# dnf update --security# dnf -y update --security或者:
# dnf update --security -y# dnf check-update --security# dnf repolist# dnf repolist# dnf clean all# dnf makecache# dnf history# dnf history info# vim /root/12456.sh创建以下内容:
#!/bin/bash
for i in {1..5}
do
echo $i
done(补充:这里以创建 /etc/root/for.sh 脚本为例)
# vim /etc/systemd/system/12456.service创建以下内容:
[Unit]
Description=12345
After=default.target
[Service]
Type=oneshot
ExecStart=/root/12456.sh
[Install]
WantedBy=default.target(补充:这里以创建 /etc/systemd/system/12456.service 来管理 ExecStart=/root/12456.sh 为例)
# systemctl daemon-reload# chmod u+x /etc/systemd/system/12456.service# systemctl start 12456.service# systemctl stop 12456.service# systemctl restart 12456.service# systemctl enable 12456.service通过系统日志显示程序被关闭的原因
# vim /var/log/message或者:
# journalctl或者:
# dmesg –T(补充:这里的 -T 代表要显示时间)
在 TeamViewer 的官网上下载软件 TeamViewer:
https://www.teamviewer.cn/cn/download/linux/
服服务器系统要配置好可用的软件源
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/e/epel-release-8-8.el8.noarch.rpm# yum groupinstall -y "Server with GUI"# vim /etc/gdm/custom.conf将以下内容:
#WaylandEnable=false修改为:
WaylandEnable=false(补充:此步骤是为了避免让 TeamViewer 连接时出现黑屏)
# systemctl set-default graphical.target# yum -y localinstall teamviewer_15.9.5.x86_64.rpm(补充:这里以安装 15.9.5.x86_64 版本的 teamviewer 为例)
# reboot