最近想通过公司的RHCE考试,所以安装了一个RHEL6来练习,一开始我安装的是Base,所以一进去是就是命令行的。
但是RHCE的教程一开始有介绍图形界面下的一些使用,为了补缺补漏,还是想安装一下图形界面玩玩的。所以我网上找了下资料,具体的操作如下:
但是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.查看软件包组
顺便看看刚才挂载上的源是否可用。
点击(此处)折叠或打开
- [tekkamanninja@Tekkaman-RHEL ~]$ yum grouplist
- Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
- Not root, certificate-based repositories not updated
- Setting up Group Process
- HighAvailability | 4.0 kB 00:00 ...
- HighAvailability/primary_db | 43 kB 00:00 ...
- LoadBalancer | 3.9 kB 00:00 ...
- LoadBalancer/primary_db | 4.7 kB 00:00 ...
- Server | 4.0 kB 00:00 ...
- Server/primary_db | 3.1 MB 00:00 ...
- HighAvailability/group_gz | 4.1 kB 00:00 ...
- LoadBalancer/group_gz | 2.2 kB 00:00 ...
- Server/group_gz | 204 kB 00:00 ...
- Installed Groups:
- Additional Development
- Base
- Console internet tools
- Debugging Tools
- Desktop
- Desktop Platform
- Dial-up Networking Support
- Directory Client
- E-mail server
- Fonts
- General Purpose Desktop
- Graphical Administration Tools
- Hardware monitoring utilities
- Java Platform
- Large Systems Performance
- Legacy UNIX compatibility
- Legacy X Window System compatibility
- NFS file server
- Network Infrastructure Server
- Network file system client
- Networking Tools
- Performance Tools
- Perl Support
- Scientific support
- Server Platform
- Installed Language Groups:
- Arabic Support [ar]
- Armenian Support [hy]
- Georgian Support [ka]
- Hebrew Support [he]
- Inuktitut Support [iu]
- Japanese Support [ja]
- Korean Support [ko]
- Lao Support [lo]
- Tajik Support [tg]
- Available Groups:
- Backup Client
- Backup Server
- CIFS file server
- Client management tools
- Compatibility libraries
- Desktop Debugging and Performance Tools
- Desktop Platform Development
- Development tools
- Directory Server
- Eclipse
- Emacs
- FCoE Storage Client
- FTP server
- Graphics Creation Tools
- High Availability
- High Availability Management
- Identity Management Server
- Infiniband Support
- Input Methods
- Internet Browser
- KDE Desktop
- Load Balancer
- Mainframe Access
- Messaging Client Support
- MySQL Database client
- MySQL Database server
- Network Storage Server
- PHP Support
- PostgreSQL Database client
- PostgreSQL Database server
- Print Server
- Printing client
- Remote Desktop Clients
- Ruby Support
- SNMP Support
- Security Tools
- Server Platform Development
- Smart card support
- Somali Support
- Storage Availability Tools
- System Management
- System administration tools
- Systems Management Messaging Server support
- 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
- iSCSI Storage Client
- Available Language Groups:
- Afrikaans Support [af]
- Albanian Support [sq]
- Amazigh Support [ber]
- Assamese Support [as]
- Azerbaijani Support [az]
- Basque Support [eu]
- Belarusian Support [be]
- Bengali Support [bn]
- Bhutanese Support [dz]
- Brazilian Portuguese Support [pt_BR]
- Breton Support [br]
- Bulgarian Support [bg]
- 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]
- Estonian Support [et]
- Ethiopic Support [am]
- Faroese Support [fo]
- Fijian Support [fj]
- Filipino Support [fil]
- Finnish Support [fi]
- French Support [fr]
- Frisian Support [fy]
- Friulian Support [fur]
- Gaelic Support [gd]
- Galician Support [gl]
- German Support [de]
- Greek Support [el]
- Gujarati Support [gu]
- Hiligaynon Support [hil]
- Hindi Support [hi]
- Hungarian Support [hu]
- Icelandic Support [is]
- Indonesian Support [id]
- Interlingua Support [ia]
- Irish Support [ga]
- Italian Support [it]
- Kannada Support [kn]
- Kashmiri Support [ks]
- Kashubian Support [csb]
- Kazakh Support [kk]
- Khmer Support [km]
- Kinyarwanda Support [rw]
- Konkani Support [kok]
- Kurdish Support [ku]
- Latin Support [la]
- Latvian Support [lv]
- Lithuanian Support [lt]
- Low Saxon Support [nds]
- Luxembourgish Support [lb]
- Macedonian Support [mk]
- Maithili Support [mai]
- Malagasy Support [mg]
- Malay Support [ms]
- Malayalam Support [ml]
- Maltese Support [mt]
- Manx Support [gv]
- Maori Support [mi]
- Marathi Support [mr]
- Mongolian Support [mn]
- Myanmar (Burmese) Support [my]
- Nepali Support [ne]
- Northern Sotho Support [nso]
- Norwegian Support [nb]
- Occitan Support [oc]
- Oriya Support [or]
- Persian Support [fa]
- Polish Support [pl]
- Portuguese Support [pt]
- Punjabi Support [pa]
- Romanian Support [ro]
- Russian Support [ru]
- Sanskrit Support [sa]
- Sardinian Support [sc]
- Serbian Support [sr]
- Sindhi Support [sd]
- Sinhala Support [si]
- Slovak Support [sk]
- Slovenian Support [sl]
- Southern Ndebele Support [nr]
- Southern Sotho Support [st]
- Spanish Support [es]
- Swahili Support [sw]
- Swati Support [ss]
- Swedish Support [sv]
- Tagalog Support [tl]
- Tamil Support [ta]
- Telugu Support [te]
- Tetum Support [tet]
- Thai Support [th]
- Tibetan Support [bo]
- Tsonga Support [ts]
- Tswana Support [tn]
- Turkish Support [tr]
- Turkmen Support [tk]
- Ukrainian Support [uk]
- Upper Sorbian Support [hsb]
- Urdu Support [ur]
- Uzbek Support [uz]
- Venda Support [ve]
- Vietnamese Support [vi]
- Walloon Support [wa]
- Welsh Support [cy]
- Xhosa Support [xh]
- Zulu Support [zu]
- Done
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图形界面