在某种场合之下,我们使用的Linux还是要选择安装桌面环境的,所以在这里介绍一下如何给没有安装桌面环境的系统安装桌面环境。
以Centos 6.5 为例演示一下如何安装桌面环境。
一、首先查看系统的运行级别以及是否安装了桌面环境
1、使用命令 runlevel 查看当前系统运行级别 ,如图所示
2、使用命令 yum grouplist | more 查看是否安装了桌面环境的组件,如图所示
二、再次从上面分析的结果看到,当前运行级别是3,而且也没有安装桌面环境的软件。
然后我们使用命令查看一下桌面有哪些桌面环境的软件,然后装显示出来的软件组件就可以了。例如:
[root@localhost ~]#
[root@localhost ~]# yum grouplist | more 查看系统已装组件和未装组件
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
* base: mirrors.usc.edu
* extras:centos.mirror.ndchost.com
* updates: mirror-centos.hostingswift.com
Installed Groups:
E-mail server
Security Tools
Storage Availability Tools
iSCSI Storage Client
Available Groups:
Additional Development
Backup Client Backup Server
Base CIFS file server
Client management tools
Compatibility libraries
Console internet tools
Debugging Tools
Desktop
Desktop Debugging and Performance Tools
Desktop Platform
Desktop Platform Development
Development tools
Dial-up Networking Support
Directory Client
Directory Server
Eclipse
Emacs
FCoE Storage Client
FTP server
Fonts
General Purpose Desktop
Graphical Administration Tools
Graphics Creation Tools
Hardware monitoring utilities
High Availability
High Availability Management
Identity Management Server
Infiniband Support
Input Methods
Internet Applications
Internet Browser
Java Platform
KDE Desktop
Large Systems Performance
Legacy UNIX compatibility
Legacy X Window System compatibility
Load Balancer
Mainframe Access
Messaging Client Support
MySQL Database client
MySQL Database server
NFS file server
Network Infrastructure Server
Network Storage Server
Network file system client
Networking Tools
Office Suite and Productivity
PHP Support
Performance Tools
Perl Support PostgreSQL
Database client
PostgreSQL Database server
Print Server
Printing client
Remote Desktop Clients
Resilient Storage
Ruby Support
SNMP Support
Scientific support
Server Platform
Server Platform Development
Smart card support
System Management
System administration tools
TeX support Technical Writing
TurboGears application framework
Virtualization
Virtualization Client
Virtualization Platform
Virtualization Tools
Web Server
Web Servlet Engine
Web-Based Enterprise Management
X Window System
Available Language Groups:
Catalan Support [ca]
Chhattisgarhi Support [hne]
Chichewa Support [ny]
Chinese Support [zh]
Coptic Support [cop]
Croatian Support [hr]
Czech Support [cs]
Danish Support [da]
Dutch Support [nl]
English (UK) Support [en_GB]
Esperanto Support [eo]
Telugu Support [te]
Tetum Support [tet]
Zulu Support [zu]
Done
===========================================
从上面的软件组信息,挑选与桌面环境有关的软件组,然后安装即可,我下面选择的软件组与输入法还有字体等桌面环境需要用到的供大家参考一下。
安装桌面组件
yum groupinstall -y "Desktop" "Desktop Platform" "Desktop Platform Development" "Fonts" "General Purpose Desktop" "Graphical Administration Tools" "Graphics Creation Tools" "Input Methods" "X Window System" "Chinese Support [zh]" "Internet Browser"
后面的是安装软件过程,需要等等一阵时间。
三、安装好了桌面环境的软件,然后再修改一下系统的启动级别 为 5
编辑/etc/inittab文件,修改启级别为5,如下图,然后重新启动就可以进入桌面环境了。因为我这是远程环境的,只是运用了命令行,可以使用VNC进行桌面环境的远程。
将 id:3:initdefault: 改为 id:5:initdefault:
四、重启的过程中,设置一下桌面环境的几个参数就可以正常进入登陆界面了,谢谢。
# reboot
CentOS 6.x 如何安装图形界面?(GNOME 和 KDE)
http://help.92cloud.com/linux/668.html
操作系统:【CentOS 6.4 x64】
- yum groupinstall “X Window System” -y #命令行模式安装图形界面
- yum groupinstall “Desktop” -y # CentOS 6.x版本安装GNOME包
# yum groupinstall “GNOME Desktop Environment” -y # CentOS 5.x版本安装GNOME包 - yum groupinstall “Chinese Support” -y #安装中文语言
- 安装成功后输入startx,或者 init 5, 即可切换到图形界面(临时生效)
- 要下次自动启动GNOME进入图形界面操作: (永久生效) 修改/etc/inittab文件中的id:3:initdefault将3改为5id:5:initdefault保存后重新启动系统.
- 输入字母i,进入插入模式
- 用方向键,把光标移到数字3上,把3改为5
- 按ESC键,进入命令模式
- 输入【 :wq 】,并按回车键,保存修改,并退出
- 重启主机,让设置生效,命令:shutdown -r now
- 验证成果,Putty输出不了图形界面,要看到图形界面,目前所知,只有通过“控制台”或者“Xmanager”远程工具。Xmanager下载:http://www.netsarang.com/download/main.html
- yum groupinstall “X Window System” -y #命令行模式安装图形界面
- yum groupinstall “KDE Desktop” -y # CentOS 6.x版本安装KDE包 # yum groupinstall “KDE (K Desktop Environment)” -y # CentOS 5.x版本安装KDE包
- yum groupinstall “Chinese Support” -y #安装中文语言
- 安装成功后输入startx,或者 init 5 ,即可切换到图形界面(临时生效)
- 要下次自动启动KDE进入图形界面操作: 修改/etc/inittab文件中的id:3:initdefault将3改为5id:5:initdefault保存后重新启动系统.