如果在安装过程中忘记安装图形界面,后期可以在命令行下面进行安装。

  1. 先把安装光盘mount到系统中。

    如果安装映像mount到/mnt/DVD目录下

    [ncapp@nrb-ncapp-p01 ~]$ mount -l
    /dev/mapper/vg_nrbncappp01-LogVol00 on / type ext4 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
    /dev/sda1 on /boot type ext4 (rw)
    /dev/mapper/vg_nrbncappp01-LogVol02 on /home type ext4 (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    /dev/sr0 on /media/RHEL-6.8 Server.x86_64 type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=0,gid=0,iocharset=utf8,mode=0400,dmode=0500) [RHEL-6.8 Server.x86_64]
    /dev/sr0 on /mnt/DVD type iso9660 (ro) [RHEL-6.8 Server.x86_64]

  2. 本文主要是通过yum安装,所以需要修收配置文件, 通过vi /etc/yum.repos.d/rhel-source.repo,增加红色部分代码。


    [ncapp@nrb-ncapp-p01 etc]$ cd yum.repos.d/
    [ncapp@nrb-ncapp-p01 yum.repos.d]$ ls
    packagekit-media.repo  redhat.repo  rhel-source.repo
    [ncapp@nrb-ncapp-p01 yum.repos.d]$ cat rhel-source.repo
    [local]
    name=local
    baseurl=file:///mnt/DVD
    enabled=1
    gpgcheck=0


    [rhel-source]
    name=Red Hat Enterprise Linux $releasever - $basearch - Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

    [rhel-source-beta]
    name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
    baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    [ncapp@nrb-ncapp-p01 yum.repos.d]$

  3. 查看已安装的包,和可安装的包,图形界面主要与这两个包有关系,主要与以下标记红色的包有关系,可以通过 yum groupinstall "X Windows system",  yum groupinstall "Desktop" 分别安装这两个包

    [ncapp@nrb-ncapp-p01 yum.repos.d]$ yum grouplist
    Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-
                  : manager
    Setting up Group Process
    Installed Groups:
       Additional Development
       Base
       Compatibility libraries
       Console internet tools
       Debugging Tools
       Desktop
       Desktop Debugging and Performance Tools
       Desktop Platform
       Dial-up Networking Support
       Directory Client
       E-mail server
       Fonts
       General Purpose Desktop
       Graphical Administration Tools
       Hardware monitoring utilities
       Input Methods
       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
       Security Tools
       Server Platform
       X Window System
    Installed Language Groups:
       Arabic Support [ar]
       Armenian Support [hy]
       Chinese Support [zh]
       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
       Desktop Platform Development
       Development tools
       Directory Server
       Eclipse
       Emacs
       FCoE Storage Client
       FTP server
       Graphics Creation Tools
       Guest Agents
       Identity Management Server
       Infiniband Support
       Internet Browser
       KDE Desktop
       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
       Server Platform Development
       Smart card support
       Storage Availability Tools
       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
       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]
       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]
       Somali Support [so]
       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

  4. 安装到这里就可以启动"startX",但是linux不建议有root直接登陆图形界面,我们可以新建一个普通用户。

    [ncapp@nrb-ncapp-p01 yum.repos.d] useradd xxx

    [ncapp@nrb-ncapp-p01 yum.repos.d]passwd xxx

  5. 至此,已经可以通过新建的用户使用startx进入图形界面了,但是如果这时重启的话还是会进行命令行界面,所以需要调整开机进行桌面还是命令界面。

  6. [root@redhat ~]#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:3:initdefault:
     将上面红字部分的  3改成5

  7.  3为命令行界面   5为X window图形界面

    删除redhat订阅:
    rhel6.1新增了一个redhat订阅,没有用,可以删除

  8. [root@redhat ~]# yum remove subscription*

  9. 安装桌面右键终端:
    [root@redhat ~]# yum install nautilus-open-terminal