linux安装图形界面包

时间:2021-07-11 15:09:41

linux安装图形界面包

1RHEL5配置光盘为本地yum

在安装软件的时候时常会遇到依赖性问题。我们可以通过配置yum来帮我们解决繁琐的软件依赖关系。

1.1 挂载光盘

[root@xml-ora1 mnt]# mount /dev/cdrom /mnt/cdrom/

mount: block device /dev/cdrom iswrite-protected, mounting read-only

[root@xml-ora1 mnt]# ll /mnt/cdrom/

total 3770

dr-xr-xr-x 3 root root   8192 Mar 22 2010 Cluster

dr-xr-xr-x 3 root root   8192 Mar 22 2010 ClusterStorage

-r--r--r-- 8 root root   8445 Sep 3  2008 EULA

-r--r--r-- 3 root root   8445 Mar 10 2010 eula.en_US

-r--r--r-- 8 root root  18416 Dec 1  2006 GPL

dr-xr-xr-x 4 root root   2048 Mar 22 2010 images

dr-xr-xr-x 2 root root   2048 Mar 22 2010 isolinux

1.2 修改yum源

先copy原yum源文件备份,然后用vim编辑yum文件并保存:

[root@xml-ora1 cdrom]# cp/etc/yum.repos.d/rhel-debuginfo.repo /etc/yum.repos.d/rhel-debuginfo.repo.bak

[root@xml-ora1 cdrom]# vi/etc/yum.repos.d/rhel-debuginfo.repo

[root@xml-ora1 cdrom]# more /etc/yum.repos.d/rhel-debuginfo.repo

[Cluster]

name=Red Hat Enterprise Linux $releasever -$basearch - Cluster

baseurl=file:///mnt/cdrom/Cluster

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[ClusterStorage]

name=Red Hat Enterprise Linux $releasever -$basearch - ClusterStorage

baseurl=file:///mnt/cdrom/ClusterStorage

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[Server]

name=Red Hat Enterprise Linux $releasever -$basearch - Server

baseurl=file:///mnt/cdrom/Server

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

[VT]

name=Red Hat Enterprise Linux $releasever -$basearch - VT

baseurl=file:///mnt/cdrom/VT

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

配置文件社会自说明:

1)        [ ]内的是仓库的名称

2)        name是仓库的描述或者说资源名称

3)        baseurl 仓库的位置,Yum源的目录获取路径

4)        enabled 是否启用这个仓库,1为起用,0为禁用,本地设为1

5)        gpgcheck 是否检查GPG签名(用来验证要安装的包是不是REDHAT官方的)

 1.3 测试Yum源使用

出现如下信息,说明配置成功:

[root@xml-ora1 etc]# yum grouplist

Setting up Group Process

Installed Groups:

  Administration Tools

  Legacy Software Development

  Legacy Software Support

  Mail Server

  Network Servers

  Server Configuration Tools

  System Tools

  Text-based Internet

   XWindow System

Available Groups:

  Authoring and Publishing

  Cluster Storage

  Clustering

  DNS Name Server

  Development Libraries

  Development Tools

  Editors

  Engineering and Scientific

  FTP Server

  GNOME Desktop Environment

  GNOME Software Development

  Games and Entertainment

  Graphical Internet

  Graphics

  Java Development

  KDE (K Desktop Environment)

  KDE Software Development

  KVM

  Legacy Network Server

  MySQL Database

  News Server

  Office/Productivity

  OpenFabrics Enterprise Distribution

  PostgreSQL Database

  Printing Support

  Sound and Video

  Web Server

  Windows File Server

   XSoftware Development

  Xen

Done

2、安装XWindow包

[root@xml-ora1 etc]#yum groupinstall "X Window System"

Transaction Summary

===============================================================================

Install    176 Package(s)

Upgrade       0 Package(s)

 

Total download size: 95 M

Is this ok [y/N]: y

Downloading Packages:

--------------------------------------------------------------------------------

Total                                           511MB/s |  95 MB     00:00    

warning: rpmts_HdrFromFdno: Header V3 DSAsignature: NOKEY, key ID 37017186

Server/gpgkey                                            |1.1 kB     00:00    

Importing GPG key 0x37017186 "Red Hat,Inc. (release key) <security@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

 Installing     : libbonobo                                             1/176

……

  xorg-x11-xkb-utils.x86_640:1.0.2-2.1                                        

 xsri.x86_64 1:2.1.0-10.fc6                                                   

 xulrunner.x86_64 0:1.9.0.18-1.el5_4                                          

 yelp.x86_64 0:2.16.0-22.el5                                                   

Complete!

此时说明成功安装图形界面包,再次用yum安装的时候,会出现已经安装的包,如果手动安装则按照下面的包进行安装,不过很多依赖包的安装比较麻烦。

 

[root@xml-ora1 etc]# yum groupinstall "X WindowSystem"

Setting up Group Process

Package xorg-x11-fonts-misc-7.1-2.1.el5.noarchalready installed and latest version

Packagexorg-x11-server-Xorg-1.1.1-48.76.el5.x86_64 already installed and latestversion

Packagexorg-x11-fonts-ISO8859-1-75dpi-7.1-2.1.el5.noarch already installed and latestversion

Package xorg-x11-fonts-100dpi-7.1-2.1.el5.noarchalready installed and latest version

Packagexorg-x11-fonts-75dpi-7.1-2.1.el5.noarch already installed and latest version

Package 1:xorg-x11-xauth-1.0.1-2.1.x86_64already installed and latest version

Package desktop-backgrounds-basic-2.0-37.noarchalready installed and latest version

Packagexorg-x11-fonts-ISO8859-1-100dpi-7.1-2.1.el5.noarch already installed and latestversion

Package xorg-x11-xinit-1.0.2-15.el5.x86_64already installed and latest version

Package xorg-x11-fonts-truetype-7.1-2.1.el5.noarchalready installed and latest version

Package 1:xorg-x11-xfs-1.0.2-4.x86_64already installed and latest version

Packagexorg-x11-fonts-Type1-7.1-2.1.el5.noarch already installed and latest version

Package bitmap-fonts-0.3-5.1.1.noarchalready installed and latest version

Package xorg-x11-drivers-7.1-4.2.el5.x86_64already installed and latest version

Package 1:xorg-x11-twm-1.0.1-3.1.x86_64already installed and latest version

Package xorg-x11-apps-7.1-4.0.1.el5.x86_64already installed and latest version

Package pirut-1.3.28-17.el5.noarch alreadyinstalled and latest version

Package openssh-askpass-4.3p2-41.el5.x86_64already installed and latest version

Packagerhn-setup-gnome-0.4.20-33.el5.noarch already installed and latest version

Package liberation-fonts-1.0-1.el5.noarchalready installed and latest version

Package firstboot-1.4.27.8-1.el5.x86_64already installed and latest version

Packagesystem-config-display-1.0.48-2.el5.noarch already installed and latest version

Package freeglut-2.4.0-7.1.el5.x86_64already installed and latest version

Package freeglut-2.4.0-7.1.el5.i386 alreadyinstalled and latest version

Package 1:gdm-2.16.0-56.el5.x86_64 alreadyinstalled and latest version

Package policycoreutils-gui-1.33.12-14.8.el5.x86_64already installed and latest version

Package rhgb-0.16.4-8.el5.x86_64 alreadyinstalled and latest version

Package synaptics-0.14.4-8.fc6.x86_64already installed and latest version

Package krb5-auth-dialog-0.7-1.x86_64already installed and latest version

Packagesystem-config-soundcard-2.0.6-1.el5.noarch already installed and latest version

Package xterm-215-8.el5_4.1.x86_64 alreadyinstalled and latest version

Package dejavu-lgc-fonts-2.10-1.noarchalready installed and latest version

Package linuxwacom-0.7.8.3-8.el5.x86_64already installed and latest version

Packagesystem-config-services-0.9.4-5.el5.noarch already installed and latest version

Package vnc-server-4.1.2-14.el5_3.1.x86_64already installed and latest version

Packagesystem-config-date-1.8.12-4.el5.noarch already installed and latest version

Package glx-utils-6.5.1-7.8.el5.x86_64already installed and latest version

Package wdaemon-0.14-5.x86_64 alreadyinstalled and latest version

Package authconfig-gtk-5.3.21-6.el5.x86_64already installed and latest version

Packagesystem-config-printer-0.7.32.10-1.el5.x86_64 already installed and latestversion

Packagesystem-config-network-1.3.99.18-1.el5.noarch already installed and latestversion

Package bitstream-vera-fonts-1.10-7.noarchalready installed and latest version

Packagesystem-config-users-1.2.51-4.el5.noarch already installed and latest version

No packages in any requested groupavailable to install or update

 

3、启动XWindow

此时如果启动图形界面的话,看到的图形界面是linux原始的图形界面,如下:


         如果想出现桌面的话,还需要安装Desktop组件,用yum grouplist查看下组件列表:

GNOME Desktop Environment和KDE (KDesktop Environment)并未安装。

4、安装GNOME图形桌面

[root@xml-ora1 etc]# yum groupinstall "GNOMEDesktop Environment"

zenity                        x86_64   2.16.0-2.el5             Server   1.2 M

Transaction Summary

===============================================================================

Install    145 Package(s)

Upgrade       0 Package(s)

Total download size: 124 M

Is this ok [y/N]: y

Downloading Packages:

--------------------------------------------------------------------------------

Total                                           1.4GB/s | 124 MB     00:00  

…… 

Running rpm_check_debug

Running Transaction Test

 xorg-x11-server-Xnest.x86_64 0:1.1.1-48.76.el5                               

 zenity.x86_64 0:2.16.0-2.el5                                                  

Complete!

5、启动GNOME图形桌面

[root@xml-ora1 etc]# startx

出现正常安装的linux图形界面则说明安装成功。

6、图形桌面常用命令

6.1、已安装组件和未安装组件查看

[root@xml-ora1 etc]#yum grouplist

6.2 安装xwindow包

如果系统安装之初采用最小化安装,没有安装xwindow,那么先安装

[root@xml-ora1 etc]# yum groupinstall "X WindowSystem"

6.3 安装卸载GNOME桌面环境

安装GNOME桌面环境

[root@xml-ora1 etc]#yum groupinstall "GNOME Desktop Environment"

 

卸载GNOME桌面环境

[root@xml-ora1 etc]#yum groupremove "GNOME DesktopEnvironment"

6.4 安装卸载GNOME桌面环境

安装KDE桌面环境

[root@xml-ora1 etc]#yum groupinstall "KDE (K DesktopEnvironment)"

 

卸载KDE桌面环境

[root@xml-ora1 etc]#yum groupremove "KDE (K DesktopEnvironment)"

6.5 默认桌面设置和切换

默认启动桌面选择设置:

方法1: 修改/etc/sysconfig/desktop,根据需要将“DESKTOP”后面的内容改为KDE或GNOME。

方法2:在当前用户目录下建立“.xinitrc”这个文件(注意文件名前有一个点号,代表建立的是一个隐藏文件),文件的内容就一行startkde或gnome-session,根据自己的需要选择KDE或GNOME。

 

GNOME和KDE的切换(“#”后面为输入命令)

1、如果需要切换到GNOME:

[root@xml-ora1 etc]#switchdesk gnome

2、如果需要切换到KDE:

[root@xml-ora1 etc]#switchdesk kde

6.6 退出图形界面

可以直接按 ctrl + alt + F1或者 ctal + alt + F2 等切换到文本控制台。或者图形界面菜单里面有选项的,选择退出或者关机的时候有选择退出到文本界面。