1、查看Linux系统环境
cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
查看操作系统是否安装了桌面系统
[root@localhost xrdp]# rpm -q desktop
package desktop is not installed
[root@localhost xrdp]#
ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm"
3、在一台有网的机器下载xrdp相关包
yum install --downloadonly --downloaddir=/soft/xrdp epel-release xrdp tigervnc-server
然后切换到/soft/xrdp目录进行安装
rpm -Uvh *.rpm
1、下载完成后tar
tar -czvf xrdp.tar.gz xrdp
2、下载桌面环境 GNOME
yum groupinstall GROUP --downloadonly --downloaddir=/soft/desk "GNOME Desktop" "Graphical Administration Tools"
切换到 /soft/desk目录
压缩文件
tar -czvf desk.tar.gz desk
4、离线服务器安装xrdp和桌面环境
1、将打好的压缩包复制到离线环境的Centos7环境中去
分别执行
tar -zxvf xrdp.tar.gz
tar -zxvf desk.tar.gz
分别到xrdp和desk目录中进行离线脚本安装
rpm -Uvh *.rpm
2、xrdp安装完成后需要启动
启动xrdp服务
systemctl enable xrdp
systemctl start xrdp
systemctl restart xrdp
systemctl status xrdp
3、远程桌面程序执行完成后需要
reboot
6、远程连接
cmd命令行输入
mstsc进行连接
注意:
一开始安装完xrdp后发现只有mstsc一连接就闪退出来。后面才发现该系统没有安装桌面系统。
其他脚本
下载安装包和依赖包:
yum install --downloadonly --downloaddir=/docker docker
安装包已经安装再次下载:
yum reinstall --downloadonly --downloaddir=/docker docker
没有-downloadonly命令,需要安装:
yum install -y yum-plugin-downloadonly
只下载安装包不安装:
yum downloader --destdir=/docker docker --resolve docker
查看操作系统
cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
yum install --downloadonly --downloaddir=/soft/xrdp epel-release
yum reinstall --downloadonly --downloaddir=/soft/xrdp epel-release xrdp tigervnc-server
yum install --downloadonly --downloaddir=/soft/xrdp mariadb-server
下载后再次安装 下载文件到指定目录
yum reinstall --downloaddir=/soft/xrdp epel-release xrdp tigervnc-server
yum reinstall --downloaddir=/soft/xrdp epel-release xrdp tigervnc
scp tigervnc-license-1.8.0-33.el7_9.noarch.rpm root@192.168.12.77:/tmp/
Ikasinfo2023#
rpm -ivh *.rpm
yum install package 安装下载的软件包
yum localinstall package 从本机目录安装软件包(本地已经存在rpm包,会自动联网处理可能存在的依赖)
yum groupinstall group 安装某个组件的全部软件包
yum groupinstall GROUP --downloadonly --downloaddir=/soft/desk "GNOME Desktop" "Graphical Administration Tools"
1、开始yumyum有一个配置 是保留缓存的包
1、
下载rpm以及相关依赖
yum install --downloadonly --downloaddir=下载对象目录 名称
yum install --downloadonly --downloaddir=/soft/xrdp epel-release xrdp tigervnc-server
2、
使用下载的rpm进行离线安装
rpm -Uvh *.rpm
rpm -Uvh --force --nodeps *.rpm
tar -czvf xrdp.tar.gz xrdp
# 3. 启动xrdp服务
systemctl enable xrdp
systemctl start xrdp
systemctl restart xrdp
systemctl status xrdp
查看默认3389端口在不在
netstat -tunlp
a.
检查是否带桌面环境
rpm -q desktop
b.下载桌面环境
yum groupinstall GROUP --downloadonly --downloaddir=/soft/desk "GNOME Desktop" "Graphical Administration Tools"
c.离线安装桌面环境
rpm -Uvh *.rpm
/usr/lib/comsol/compactPath.ini
yum downloader --destdir=/soft/xrdp docker --resolve epel-release