RHEL6 命令行下安装图形桌面

http://blog.chinaunix.net/uid-20543672-id-3562177.html

最近想通过公司的RHCE考试,所以安装了一个RHEL6来练习,一开始我安装的是Base,所以一进去是就是命令行的。
但是RHCE的教程一开始有介绍图形界面下的一些使用,为了补缺补漏,还是想安装一下图形界面玩玩的。所以我网上找了下资料,具体的操作如下:

一、配置本地源

1.挂载镜像文件

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ sudo mkdir /media/RHEL

  2. [tekkamanninja@Tekkaman-RHEL ~]$ sudo mount -o loop <iso-path> /media/RHEL


(可选)开机自动挂载镜像文件

在/etc/fstab的最下面添加下面一句

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ sudo vi /etc/fstab

  2. /media/RHEL iso9660 ro,loop 0 0


2.创建repo文件

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ sudo vi /etc/yum.repos.d/local_RHEL_DVD.repo

  2. [Server]
  3. name=Server
  4. baseurl=file:///media/RHEL/Server
  5. enabled=1
  6. gpgcheck=0

  7. [HighAvailability]
  8. name=HighAvailability
  9. baseurl=file:///media/RHEL/HighAvailability
  10. enabled=1
  11. gpgcheck=0

  12. [LoadBalancer]
  13. name=LoadBalancer
  14. baseurl=file:///media/RHEL/LoadBalancer
  15. enabled=1
  16. gpgcheck=0


 二、安装桌面软件包组

1.查看软件包组

顺便看看刚才挂载上的源是否可用。

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ yum grouplist
  2. Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
  3. Not root, certificate-based repositories not updated
  4. Setting up Group Process
  5. HighAvailability | 4.0 kB 00:00 ...
  6. HighAvailability/primary_db | 43 kB 00:00 ...
  7. LoadBalancer | 3.9 kB 00:00 ...
  8. LoadBalancer/primary_db | 4.7 kB 00:00 ...
  9. Server | 4.0 kB 00:00 ...
  10. Server/primary_db | 3.1 MB 00:00 ...
  11. HighAvailability/group_gz | 4.1 kB 00:00 ...
  12. LoadBalancer/group_gz | 2.2 kB 00:00 ...
  13. Server/group_gz | 204 kB 00:00 ...
  14. Installed Groups:
  15. Additional Development
  16. Base
  17. Console internet tools
  18. Debugging Tools
  19. Desktop
  20. Desktop Platform
  21. Dial-up Networking Support
  22. Directory Client
  23. E-mail server
  24. Fonts
  25. General Purpose Desktop
  26. Graphical Administration Tools
  27. Hardware monitoring utilities
  28. Java Platform
  29. Large Systems Performance
  30. Legacy UNIX compatibility
  31. Legacy X Window System compatibility
  32. NFS file server
  33. Network Infrastructure Server
  34. Network file system client
  35. Networking Tools
  36. Performance Tools
  37. Perl Support
  38. Scientific support
  39. Server Platform
  40. Installed Language Groups:
  41. Arabic Support [ar]
  42. Armenian Support [hy]
  43. Georgian Support [ka]
  44. Hebrew Support [he]
  45. Inuktitut Support [iu]
  46. Japanese Support [ja]
  47. Korean Support [ko]
  48. Lao Support [lo]
  49. Tajik Support [tg]
  50. Available Groups:
  51. Backup Client
  52. Backup Server
  53. CIFS file server
  54. Client management tools
  55. Compatibility libraries
  56. Desktop Debugging and Performance Tools
  57. Desktop Platform Development
  58. Development tools
  59. Directory Server
  60. Eclipse
  61. Emacs
  62. FCoE Storage Client
  63. FTP server
  64. Graphics Creation Tools
  65. High Availability
  66. High Availability Management
  67. Identity Management Server
  68. Infiniband Support
  69. Input Methods
  70. Internet Browser
  71. KDE Desktop
  72. Load Balancer
  73. Mainframe Access
  74. Messaging Client Support
  75. MySQL Database client
  76. MySQL Database server
  77. Network Storage Server
  78. PHP Support
  79. PostgreSQL Database client
  80. PostgreSQL Database server
  81. Print Server
  82. Printing client
  83. Remote Desktop Clients
  84. Ruby Support
  85. SNMP Support
  86. Security Tools
  87. Server Platform Development
  88. Smart card support
  89. Somali Support
  90. Storage Availability Tools
  91. System Management
  92. System administration tools
  93. Systems Management Messaging Server support
  94. TeX support
  95. Technical Writing
  96. TurboGears application framework
  97. Virtualization
  98. Virtualization Client
  99. Virtualization Platform
  100. Virtualization Tools
  101. Web Server
  102. Web Servlet Engine
  103. Web-Based Enterprise Management
  104. X Window System
  105. iSCSI Storage Client
  106. Available Language Groups:
  107. Afrikaans Support [af]
  108. Albanian Support [sq]
  109. Amazigh Support [ber]
  110. Assamese Support [as]
  111. Azerbaijani Support [az]
  112. Basque Support [eu]
  113. Belarusian Support [be]
  114. Bengali Support [bn]
  115. Bhutanese Support [dz]
  116. Brazilian Portuguese Support [pt_BR]
  117. Breton Support [br]
  118. Bulgarian Support [bg]
  119. Catalan Support [ca]
  120. Chhattisgarhi Support [hne]
  121. Chichewa Support [ny]
  122. Chinese Support [zh]
  123. Coptic Support [cop]
  124. Croatian Support [hr]
  125. Czech Support [cs]
  126. Danish Support [da]
  127. Dutch Support [nl]
  128. English (UK) Support [en_GB]
  129. Esperanto Support [eo]
  130. Estonian Support [et]
  131. Ethiopic Support [am]
  132. Faroese Support [fo]
  133. Fijian Support [fj]
  134. Filipino Support [fil]
  135. Finnish Support [fi]
  136. French Support [fr]
  137. Frisian Support [fy]
  138. Friulian Support [fur]
  139. Gaelic Support [gd]
  140. Galician Support [gl]
  141. German Support [de]
  142. Greek Support [el]
  143. Gujarati Support [gu]
  144. Hiligaynon Support [hil]
  145. Hindi Support [hi]
  146. Hungarian Support [hu]
  147. Icelandic Support [is]
  148. Indonesian Support [id]
  149. Interlingua Support [ia]
  150. Irish Support [ga]
  151. Italian Support [it]
  152. Kannada Support [kn]
  153. Kashmiri Support [ks]
  154. Kashubian Support [csb]
  155. Kazakh Support [kk]
  156. Khmer Support [km]
  157. Kinyarwanda Support [rw]
  158. Konkani Support [kok]
  159. Kurdish Support [ku]
  160. Latin Support [la]
  161. Latvian Support [lv]
  162. Lithuanian Support [lt]
  163. Low Saxon Support [nds]
  164. Luxembourgish Support [lb]
  165. Macedonian Support [mk]
  166. Maithili Support [mai]
  167. Malagasy Support [mg]
  168. Malay Support [ms]
  169. Malayalam Support [ml]
  170. Maltese Support [mt]
  171. Manx Support [gv]
  172. Maori Support [mi]
  173. Marathi Support [mr]
  174. Mongolian Support [mn]
  175. Myanmar (Burmese) Support [my]
  176. Nepali Support [ne]
  177. Northern Sotho Support [nso]
  178. Norwegian Support [nb]
  179. Occitan Support [oc]
  180. Oriya Support [or]
  181. Persian Support [fa]
  182. Polish Support [pl]
  183. Portuguese Support [pt]
  184. Punjabi Support [pa]
  185. Romanian Support [ro]
  186. Russian Support [ru]
  187. Sanskrit Support [sa]
  188. Sardinian Support [sc]
  189. Serbian Support [sr]
  190. Sindhi Support [sd]
  191. Sinhala Support [si]
  192. Slovak Support [sk]
  193. Slovenian Support [sl]
  194. Southern Ndebele Support [nr]
  195. Southern Sotho Support [st]
  196. Spanish Support [es]
  197. Swahili Support [sw]
  198. Swati Support [ss]
  199. Swedish Support [sv]
  200. Tagalog Support [tl]
  201. Tamil Support [ta]
  202. Telugu Support [te]
  203. Tetum Support [tet]
  204. Thai Support [th]
  205. Tibetan Support [bo]
  206. Tsonga Support [ts]
  207. Tswana Support [tn]
  208. Turkish Support [tr]
  209. Turkmen Support [tk]
  210. Ukrainian Support [uk]
  211. Upper Sorbian Support [hsb]
  212. Urdu Support [ur]
  213. Uzbek Support [uz]
  214. Venda Support [ve]
  215. Vietnamese Support [vi]
  216. Walloon Support [wa]
  217. Welsh Support [cy]
  218. Xhosa Support [xh]
  219. Zulu Support [zu]
  220. Done

2.安装软件组


从上面的信息中你可以看到许多的软件组信息,自己挑一个需要的桌面软件组安装就好了,我先装Desktop

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ sudo yum groupinstall "Desktop"

3.测试:启动图形界面


在完成了软件的安装之后,你就可以尝试进入X 桌面了:

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ startx



但是极有可能你无法进入图形界面,原因非常简单,你还没有安装相应的X 用户层驱动,不同的硬件有不同的驱动,所以这个不是由软件依赖来解决的

对于我用于练习的ThinkPad SL400来说,我得到了如下错误: 

点击(此处)折叠或打开

  1. [ 278.139] (II) LoadModule: "nouveau"
  2. [ 278.140] (WW) Warning, couldn't open module nouveau
  3. [ 278.140] (II) UnloadModule: "nouveau"
  4. [ 278.140] (II) Unloading nouveau
  5. [ 278.140] (EE) Failed to load module "nouveau" (module does not exist, 0)
  6. [ 278.140] (II) LoadModule: "vesa"
  7. [ 278.140] (II) Loading /usr/lib64/xorg/modules/drivers/vesa_drv.so
  8. [ 278.140] (II) Module vesa: vendor="X.Org Foundation"
  9. [ 278.140] compiled for 1.10.2, module version = 2.3.0
  10. [ 278.140] Module class: X.Org Video Driver
  11. [ 278.140] ABI class: X.Org Video Driver, version 10.0
  12. [ 278.140] (II) LoadModule: "fbdev"
  13. [ 278.140] (WW) Warning, couldn't open module fbdev
  14. [ 278.140] (II) UnloadModule: "fbdev"
  15. [ 278.140] (II) Unloading fbdev
  16. [ 278.140] (EE) Failed to load module "fbdev" (module does not exist, 0)
  17. [ 278.140] (II) VESA: driver for VESA chipsets: vesa
  18. [ 278.140] (--) using VT number 1

  19. [ 278.145] (EE) The PCI device has a kernel module claiming it,
  20. [ 278.146] (EE) this driver cannot operate until it has been unloaded.
  21. [ 278.146] (EE) Try appending "nomodeset" to your boot options
  22. [ 278.146] (WW) Falling back to old probe method for vesa
  23. [ 278.146] (EE) No devices detected.
  24. [ 278.146]
  25. Fatal server error:
  26. [ 278.146] no screens found
  27. [ 278.146]
  28. Please consult the Red Hat, Inc. support
  29. at https://www.redhat.com/apps/support/
  30. for help.
  31. [ 278.146] Please also check the log file at "/var/log/Xorg.0.log" for additional information.
  32. [ 278.147]


所以我就通过 yum list 命令找到了相应的驱动包,然后安装。

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ sudo yum list *nouveau*
  2. Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
  3. Updating certificate-based repositories.
  4. Unable to read consumer identity
  5. Available Packages
  6. xorg-x11-drv-nouveau.x86_64 1:0.0.16-13.20110719gitde9d1ba.el6 Server
  7. [tekkamanninja@Tekkaman-RHEL ~]$ sudo yum install xorg-x11-drv-nouveau

安装好了之后,再“startx”,图形界面就出来了。
其实你还可以再log中找到其他缺少的模块,同样的通过
 yum list 命令找到了相应的驱动包,然后安装就是了。



3.更改启动模式 :进入桌面还是命令界面

点击(此处)折叠或打开

  1. [tekkamanninja@Tekkaman-RHEL ~]$ sudo vim /etc/inittab
  2. # System initialization is started by /etc/init/rcS.conf
  3. #
  4. # Individual runlevels are started by /etc/init/rc.conf
  5. #
  6. # Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
  7. #
  8. # Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
  9. # with configuration in /etc/sysconfig/init.
  10. #
  11. # For information on how to write upstart event handlers, or how
  12. # upstart works, see init(5), init(8), and initctl(8).
  13. #
  14. # Default runlevel. The runlevels used are:
  15. # 0 - halt (Do NOT set initdefault to this)
  16. # 1 - Single user mode
  17. # 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
  18. # 3 - Full multiuser mode
  19. # 4 - unused
  20. # 5 - X11
  21. # 6 - reboot (Do NOT set initdefault to this)
  22. #
  23. id:5:initdefault:

注释说的在清楚不过了,3为多用户界面(命令行)   5为X window图形界面

参考资料:

RHEL6 纯命令行文本界面下安装桌面

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值