centos安装桌面

参考如下文章:

CentOS 7一键安装桌面环境命令(可远程RDP连接)_RedHat/Centos_操作系统_脚本之家

执行一键脚本

yum install curl ca-certificates -y && curl -sSL https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/main/install.sh | sudo bash

它的介绍

只需一键,即可为CentOS安装桌面环境和RDP远程桌面连接。

为您的Linux系统运行Windows应用程序。脚本自动帮你安装Wine X64和X86,现在可以在Linux上运行Windows应用程序。例如:Telegram、WeChat、Thunder

默认创建3GB交换内存。 避免内存不足导致的错误。(交换位置:/var/swapd)

自动安装中文输入环境,中文支持。

安装人们推荐的软件,例如浏览器和输入法。(包含Chrome,Firefox)

安装远程桌面客户端。(支持RDP/SSH/NX/SFTP/VNC/XDMCP协议)

脚本内容:避免下载超时,脚本粘贴到这里记录下

#!/bin/bash

echo "---------------------------------------------------------------------------------------------------------------------"
echo "Welcome to Desktop environment and Remote connection tool ! V1.0.0"
echo "System requirements: CentOS 7+ New installation"
echo "Recommended system : [Original] Network one-click Reinstall CentOS 7 (Official, Pure, Safe, Efficient)"
echo "URL : https://tech.cxthhhhh.com/linux/2018/07/30/original-network-one-click-reinstall-centos-7-official-pure-safe-efficient-en.html"
echo "---------------------------------------------------------------------------------------------------------------------"
echo "from https://tech.cxthhhhh.com - 2018/08/07 - MeowLove"
echo "---------------------------------------------------------------------------------------------------------------------"
echo Press any key to continue! Exit with 'Ctrl'+'C' !

echo -e "\n"
sudo cd /root
yum install epel-release -y
echo "Start creating Swaps Memory, please wait..."
dd if=/dev/zero of=/var/swapd bs=1024 count=3145728
mkswap /var/swapd
chmod 0644 /var/swapd
swapon /var/swapd
echo '/var/swapd   swap   swap   default 0 0' >> /etc/fstab
echo "---------------------------------------------------------------------------------------------------------------------"
echo "Swaps Memory is Created  is [OK]"
echo "---------------------------------------------------------------------------------------------------------------------"

echo -e "\n"
sudo cd /root
yum groupinstall "X Window System" -y
yum groupinstall "MATE Desktop" -y
yum groupinstall "Chinese support" -y
yum groups mark install "Chinese support" -y
yum install cjkuni-ukai-fonts cjkuni-uming-fonts -y
yum install fontforge -y
yum install ibus-libpinyin im-chooser -y
localectl set-locale LANG=zh_CN.UTF8
echo "---------------------------------------------------------------------------------------------------------------------"
echo "Desktop environment is installed  is [OK]"
echo "---------------------------------------------------------------------------------------------------------------------"

echo -e "\n"
sudo cd /root
touch /etc/yum.repos.d/google-chrome.repo
echo '[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl.google.com/linux/linux_signing_key.pub'>/etc/yum.repos.d/google-chrome.repo
echo -e "\n"
cat /etc/yum.repos.d/google-chrome.repo
yum install google-chrome-stable -y
echo "---------------------------------------------------------------------------------------------------------------------"
echo "The Chrome Already installed  is [OK]"
echo "---------------------------------------------------------------------------------------------------------------------"

echo -e "\n"
sudo cd /root
rpm -Uvh --force https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/nux-dextop/nux-dextop-release-0-5.el7.nux.noarch.rpm --quiet
yum install remmina remmina-plugins-* -y
echo "---------------------------------------------------------------------------------------------------------------------"
echo "The Remmina Already installed  is [OK]"
echo "---------------------------------------------------------------------------------------------------------------------"

echo -e "\n"
sudo cd /root
rpm -Uvh --force https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/wine/wine32-release.rpm --quiet
yum install wine.i686 -y
yum install wine -y
sudo wget -O /usr/share/wine/fonts/msyh.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/msyh.ttc
sudo wget -O /usr/share/wine/fonts/msyhbd.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/msyhbd.ttc
sudo wget -O /usr/share/wine/fonts/msyhl.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/msyhl.ttc
sudo wget -O /usr/share/wine/fonts/simfang.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simfang.ttf
sudo wget -O /usr/share/wine/fonts/simhei.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simhei.ttf
sudo wget -O /usr/share/wine/fonts/simkai.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simkai.ttf
sudo wget -O /usr/share/wine/fonts/SIMLI.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/SIMLI.ttf
sudo wget -O /usr/share/wine/fonts/simsun.ttc https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/simsun.ttc
sudo wget -O /usr/share/wine/fonts/SIMYOU.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/SIMYOU.ttf
sudo wget -O /usr/share/wine/fonts/浠垮畫_GB2312.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/浠垮畫_GB2312.ttf
sudo wget -O /usr/share/wine/fonts/妤蜂綋_GB2312.ttf https://raw.githubusercontent.com/MeowLove/CentOS-One-click-Installation-of-Desktop-Environment-and-Remote-Desktop-Connection-RDP/master/download/ttf/妤蜂綋_GB2312.ttf
echo "---------------------------------------------------------------------------------------------------------------------"
echo "The Wine Already installed  is [OK]"
echo "---------------------------------------------------------------------------------------------------------------------"

echo -e "\n"
sudo cd /root
yum install tigervnc-server tigervnc -y
yum install xrdp -y
touch ~/.Xclients
echo "mate-session" > ~/.Xclients
chmod a+x ~/.Xclients
systemctl enable xrdp
systemctl start xrdp
firewall-cmd --add-port=3389/tcp --permanent
firewall-cmd --reload
echo "---------------------------------------------------------------------------------------------------------------------"
echo "Remote connection RDP is installed  is [OK]"
echo "---------------------------------------------------------------------------------------------------------------------"

echo -e "\n\n\n"
echo "---------------------------------------------------------------------------------------------------------------------"
echo "The current default system language is Chinese."
echo "If you are an English user, please execute ' sudo localectl set-locale LANG=en_US.UTF-8 '"
echo "---------------------------------------------------------------------------------------------------------------------"
echo "Warning: Now, you need to pay attention to the following, please visit this page."
echo "[Original] One-click installation of Desktop environment, RDP, Windows support for Linux"
echo "https://tech.cxthhhhh.com/linux/2018/08/07/original-one-click-installation-of-desktop-environment-rdp-windows-support-for-linux-en.html"
echo "---------------------------------------------------------------------------------------------------------------------"
echo "End to Desktop environment and Remote connection tool ! V1.0.0"
echo "Everything is ready and the system is restarting. Then you can connect via (RDP)IP:3389."
echo "---------------------------------------------------------------------------------------------------------------------"
echo "from https://tech.cxthhhhh.com - 2018/08/07 - MeowLove"
echo "---------------------------------------------------------------------------------------------------------------------"
reboot
echo -e "\n"

耗时较长,如果中断,可从中断处复制执行。

字体下载超级慢,下载一两个之后,其他的可以不下载,跳过也能用

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值