最近想通过公司的RHCE考试,所以安装了一个RHEL6来练习,一开始我安装的是Base,所以一进去是就是命令行的。
但是RHCE的教程一开始有介绍图形界面下的一些使用,为了补缺补漏,还是想安装一下图形界面玩玩的。所以我网上找了下资料,具体的操作如下:
一、配置本地源
1.挂载镜像文件
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo mkdir /media/RHEL
-
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo mount -o loop
> /media/RHEL
(可选)开机自动挂载镜像文件
在/etc/fstab的最下面添加下面一句
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo vi /etc/fstab
-
-
/media/RHEL iso9660 ro,loop 0 0
2.创建repo文件
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo vi /etc/yum.repos.d/local_RHEL_DVD.repo
-
-
[Server]
-
name=Server
-
baseurl=file:///media/RHEL/Server
-
enabled=1
-
gpgcheck=0
-
-
[HighAvailability]
-
name=HighAvailability
-
baseurl=file:///media/RHEL/HighAvailability
-
enabled=1
-
gpgcheck=0
-
-
[LoadBalancer]
-
name=LoadBalancer
-
baseurl=file:///media/RHEL/LoadBalancer
-
enabled=1
-
gpgcheck=0
二、安装桌面软件包组
1.查看软件包组
顺便看看刚才挂载上的源是否可用。
2.安装软件组
从上面的信息中你可以看到许多的软件组信息,自己挑一个需要的桌面软件组安装就好了,我先装Desktop
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo yum groupinstall "Desktop"
3.测试:启动图形界面
在完成了软件的安装之后,你就可以尝试进入X 桌面了:
-
[tekkamanninja@Tekkaman-RHEL ~]$ startx
但是极有可能你无法进入图形界面,原因非常简单,你还没有安装相应的X 用户层驱动,不同的硬件有不同的驱动,所以这个不是由软件依赖来解决的。
对于我用于练习的ThinkPad SL400来说,我得到了如下错误:
-
[ 278.139] (II) LoadModule: "nouveau"
-
[ 278.140] (WW) Warning, couldn't open module nouveau
-
[ 278.140] (II) UnloadModule: "nouveau"
-
[ 278.140] (II) Unloading nouveau
-
[ 278.140] (EE) Failed to load module "nouveau" (module does not exist, 0)
-
[ 278.140] (II) LoadModule: "vesa"
-
[ 278.140] (II) Loading /usr/lib64/xorg/modules/drivers/vesa_drv.so
-
[ 278.140] (II) Module vesa: vendor="X.Org Foundation"
-
[ 278.140] compiled for 1.10.2, module version = 2.3.0
-
[ 278.140] Module class: X.Org Video Driver
-
[ 278.140] ABI class: X.Org Video Driver, version 10.0
-
[ 278.140] (II) LoadModule: "fbdev"
-
[ 278.140] (WW) Warning, couldn't open module fbdev
-
[ 278.140] (II) UnloadModule: "fbdev"
-
[ 278.140] (II) Unloading fbdev
-
[ 278.140] (EE) Failed to load module "fbdev" (module does not exist, 0)
-
[ 278.140] (II) VESA: driver for VESA chipsets: vesa
-
[ 278.140] (--) using VT number 1
-
-
[ 278.145] (EE) The PCI device has a kernel module claiming it,
-
[ 278.146] (EE) this driver cannot operate until it has been unloaded.
-
[ 278.146] (EE) Try appending "nomodeset" to your boot options
-
[ 278.146] (WW) Falling back to old probe method for vesa
-
[ 278.146] (EE) No devices detected.
-
[ 278.146]
-
Fatal server error:
-
[ 278.146] no screens found
-
[ 278.146]
-
Please consult the Red Hat, Inc. support
-
at
-
for help.
-
[ 278.146] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
-
[ 278.147]
所以我就通过 yum list 命令找到了相应的驱动包,然后安装。
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo yum list *nouveau*
-
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
-
Updating certificate-based repositories.
-
Unable to read consumer identity
-
Available Packages
-
xorg-x11-drv-nouveau.x86_64 1:0.0.16-13.20110719gitde9d1ba.el6 Server
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo yum install xorg-x11-drv-nouveau
安装好了之后,再“startx”,图形界面就出来了。
其实你还可以再log中找到其他缺少的模块,同样的通过 yum list 命令找到了相应的驱动包,然后安装就是了。
3.更改启动模式 :进入桌面还是命令界面
-
[tekkamanninja@Tekkaman-RHEL ~]$ sudo vim /etc/inittab
-
# System initialization is started by /etc/init/rcS.conf
-
#
-
# Individual runlevels are started by /etc/init/rc.conf
-
#
-
# Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
-
#
-
# Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
-
# with configuration in /etc/sysconfig/init.
-
#
-
# For information on how to write upstart event handlers, or how
-
# upstart works, see init(5), init(8), and initctl(8).
-
#
-
# 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:
注释说的在清楚不过了,3为多用户界面(命令行) 5为X window图形界面
参考资料:
阅读(23355) | 评论(2) | 转发(1) |