linux 图形界面
安装GUI相关包
不用登录图形界面,只安装GUI软件相关的包:
yum install -y pango.x86_64 libXcomposite.x86_64 libXcursor.x86_64 libXdamage.x86_64 libXext.x86_64 libXi.x86_64 libXtst.x86_64 cups-libs.x86_64 libXScrnSaver.x86_64 libXrandr.x86_64 GConf2.x86_64 alsa-lib.x86_64 atk.x86_64 gtk3.x86_64 -y #字体 yum install ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc yum install -y ipa-gothic-fonts xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-utils xorg-x11-fonts-cyrillic xorg-x11-fonts-Type1 xorg-x11-fonts-misc
安装GUI登录界面
方法一
# 安装软件包 yum -y groupinstall "X Window System" yum -y install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts # 设置默认启动图形界面 unlink /etc/systemd/system/default.target ln -fs /lib/systemd/system/graphical.target /etc/systemd/system/default.target
方法二
yum groupinstall -y 'X Window System'
After that you can choose one of these available Desktop groups to install.
yum groupinstall basic-desktop desktop-platform x11 fonts
or
yum groupinstall "Desktop" "Desktop Platform" "X Window System" "Fonts"
To list all installed and available groups
yum grouplist
To remove a Group of Packages
yum groupremove "General Purpose Desktop"
To list all packages and descriptions of a group
yum groupinfo "General Purpose Desktop"
There are also some optional packages if you want something more than a gui desktop environment
yum -y groupinstall "Graphical Administration Tools" yum -y groupinstall "General Purpose Desktop" yum -y groupinstall "Office Suite and Productivity" yum -y groupinstall "Graphics Creation Tools" yum -y groupinstall "Base" yum -y groupinstall "Web Server" yum -y groupinstall "MySQL Database Server" yum -y groupinstall "Educational Software" yum -y groupinstall 'Electronic Lab" yum -y groupinstall "NFS file server" yum -y groupinstall 'Network Storage Server" yum -y groupinstall "Virtualization"
To boot to GUI directly without going to CLI mode, you need to edit /etc/inittab
nano /etc/inittab
Change
id:3:initdefault:
To
id:5:initdefault:
KDE
KDE (K Desktop Environment) is an alternative GUI for Gnome, some people prefer KDE over Gnome for some reason since they are basically similar. To install KDE on Centos, use this command on your system terminal:
yum groupinstall "KDE desktop"
Cinnamon
Created and developed by Linux Mint, Cinnamon Desktop project original known for desktop environment for Linux Mint releases. Cinnamon is built on top of Gnome but does not require gnome to be installed on your system. Lately Cinnamon is developed natively for fedora/centos OS. To install cinnamon on centos/fedora:
Become root or super user
$su-
update your system
yum update
Install cinnamon on centos/fedora
yum -y install cinnamon
MATE
MATE desktop is another great GUI or Windows Managers for Linux. Mate is very similar to Gnome 2 and uses GTK3.
To install MATE desktop on Fedora/Centos
yum update yum groupinstall "MATE Desktop"
Xfce
If you want a lightweight desktop environment, Xfce is the one for you. Unlike Gnome and KDE, Xfce takes very little resource of your system.
To install Xfce on Centos, you need to download and install the epel-release package from fedora EPEL repository, and you need wget package.
yum install wget
# For 64bit Centos system wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm # For 32bit Centos system wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm rpm -ivh epel-release-6-8.noarch.rpm
Finally, Install Xfce and few extra fonts packages for the graphical login screen in CentOS, without fonts packages you won’t be able to see any word and seeing square boxes instead.
yum groupinstall Xfce yum install xorg-x11-fonts-Type1 xorg-x11-fonts-misc
To start xfce after you install it by these commands
$/sbin/telinit5
or
$startxfce4
To start xfce automatically, you need to modify the /etc/inittab
file to change start up level to 5
nano /etc/inittab
Change
# Default runlevel. The runlevels used are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:3:initdefault:
To
# Default runlevel. The runlevels used are: # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, without NFS (The same as 3, if you do not have networking) # 3 - Full multiuser mode # 4 - unused # 5 - X11 # 6 - reboot (Do NOT set initdefault to this) # id:5:initdefault: