20150910 课后练习 RPM YUM

1、总结rpm和yum实现程序包的管理功能.

RPM

RPM解释:

RPM全称为RedhatPackageManager,最早由RedHat公司制定实施,随后被GNU开源操作系统接受并成为很多Linux系统(RHEL)的既定软件标准.

RPM的特点就是将你要安装的软件先编译过,并且打包成RPM机制的安装包。

优点:(1)已经编译好了,所以软件安装方便。

(2)在被安装,会先检查系统的硬盘容量,操作系统版本等,避免文件被错误安装。

(3)rpm本身提供软件版本信息,依赖属性软件名称,软件用途说明,软件所含文件等信息。

程序包的组成部分:

二进制程序:/bin, /sbin,/ /usr/bin, /usr/sbin,

库文件:/lib64, /usr/lib64

配置文件:/etc

帮助文件:manual, info,

命名规则:

以 zsh-4.3.11-4.el6.centos.x86_64.rpm来说明:

zsh:是软件的名字

4.3.11-4:这是软件的版本号

e16:基于该版本的软件包的发行版本号,有软件打包商设置,不一定是原始软件开发商.

x86_64:编译的软件包可以运行的处理器架构(x86_64)

特殊说明:

1、fcXX,elXX:表示这个软件包的发行商版本,就像这里的fc18,说明这个软件包是在Fedora 18下使用的。而openssl-1.0.0-20.el6.x86_64.rpm表示这个软件包是在RHEL 6.x(Red Hat Enterprise Linux)/CentOS 6.x下使用。

2、devel:表示这个RPM包是软件的开发包,例如mysql-devel-5.1.52-1.el6_0.1.i686.rpm。

3、noarch:说明这样的软件包可以在任何平台上安装,不需要特定的硬件平台。在任何硬件平台上都可以运行。

安装,卸载类:

-i:install的意思。

-v:更详细的安装信息画面

-h:显示安装进度

--nodeps:忽略依赖关系

--replacepkgs 重装软件包

-e:卸载软件包

1.安装rpm -ivh zsh-4.3.11-4.el6.centos.x86_64.rpm  安装软件包:

2安装rpm -ivh qt3-MySQL-3.3.8b-30.el6.x86_64.rpm 出现依赖包错误显示:

如果要强制安装此rpm包就需要 --nodeps 参数:

4.如果一个软件已经安装过但是想要重装的话就需要--replacepkgs

5.如果要卸载一个软件:rpm -e

查询类:

-q:仅查询,后面的软件名称是否安装。

-qa:列出系统上已经安装的所有软件名称。

-ql:列出该软件所有的文件与目录所在的完整文件名。

-qi:列出软件的详细信息,包含开发商版本说明。

-qf:查询软件由那个包生成的。

-qc:查看当前程序生成了哪些配置文件。

-p: 查询针对是未安装的程序包文件

1.查询软件包是否安装:rpm -q name:

2.查询已安装的软件:rpm -qa(我这里一共安装了454个软件)

3.查询zsh所有的文件目录:rpm -ql

4.查询zsh包含有的信息:rpm  -qi

5.查询软件由哪个包生成的:rpm -qf

6.查询当前软件生成了哪些配置文件:rpm -qc

7.查询针对未安装的程序文件:rpm -qpi ,rpm -qpl

软件更新:

-Uvh:后面跟的软件如果没有安装过,则直接安装,如果有安装旧版,则系统自动更新。

-Fvh:后面跟的软件如果没有安装过,则不会安装,只有安装到系统内部的软件会被升级。

校验:

rpm {-V|--verify} [select-options] [verify-options]

S file Size differs

M Mode differs (includes permissions and file type)

5 digest (formerly MD5 sum) differs

D Device major/minor number mismatch

L readLink(2) path mismatch

U User ownership differs

G Group ownership differs

T mTime differs

P caPabilities differ

实例:修改一个程序文件然后在校验:rpm -V zsh

[[email protected] Packages]# rpm -V zsh
S.5....T.    /usr/share/zsh/4.3.11/functions/zrecompile
[[email protected] Packages]#

包校验:

来源合法性验正:非对称加密

完整性验正:单向加密

导入密钥:rpm -ivh RPM-GPG-KEY-CentOS-6

校验:rpm -K /PATH/TO/RPM_FILE

[[email protected] Packages]# rpm -K zsh-4.3.11-4.el6.centos.x86_64.rpm
zsh-4.3.11-4.el6.centos.x86_64.rpm: rsa sha1 (md5) pgp md5 OK

YUM

YUM命令的解释:

yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器。基於RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软体包,无须繁琐地一次次下载、安装。yum提供了查找、安装、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。

yum程序的配置文件:

/etc/yum.conf

定义全局配置:对所有仓库都适用的配置

/etc/yum.repos.d/*.repo

一个文件通常用于一个或一组功能相近或相关的仓库

定义一个仓库指向:

        [REPO_ID]
        name=
        baseurl=
        # mirrorlist=SCHEME://HOSTNAME/PATH/TO/MIRROR_LIST_FILE
        enabled={1|0}
        gpgcheck={1|0}
        gpgkey=
        cost=

比如创建阿里源和epel源:

[centos]
name=Centos aliyun
baseurl=http://mirrors.aliyun.com/centos/6/os/x86_64/
enabled=1
gpgcheck=0

[Fedora-epel]
name=Fedora-epel
baseurl=http://mirrors.aliyun.com/epel/6Server/x86_64/
enabled=1
gpgcheck=0

1.安装类

yum install 安装:yum install wget

[[email protected] Packages]# yum install wget
省略:
Running Transaction
  Installing : wget-1.12-5.el6_6.1.x86_64                                                                                                                                                  1/1
  Verifying  : wget-1.12-5.el6_6.1.x86_64                                                                                                                                                  1/1
Installed:
  wget.x86_64 0:1.12-5.el6_6.1                                                                                                                                                                
Complete!
[[email protected] Packages]#

yum remove 卸载软件包:yum remove wget

[[email protected] Packages]# yum remove wget
省略:
Warning: RPMDB altered outside of yum.
  Erasing    : wget-1.12-5.el6_6.1.x86_64                                                                                                                                                  1/1
  Verifying  : wget-1.12-5.el6_6.1.x86_64                                                                                                                                                  1/1
Removed:
  wget.x86_64 0:1.12-5.el6_6.1                                                                                                                                                                
Complete!
[[email protected] Packages]#

2 更新和升级

yum update 全部更新

[[email protected] Packages]# yum update
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package ibus-table-cangjie.noarch 0:1.2.0.20100210-1.el6 will be obsoleted
---> Package ibus-table-chinese-cangjie.noarch 0:1.4.6-1.el6 will be obsoleting
省略
.
.
Complete!
[[email protected] Packages]#

yum update 包名 指定软件包更新

[[email protected] Packages]# yum update wget
Loaded plugins: fastestmirror
Setting up Update Process
Loading mirror speeds from cached hostfile
No Packages marked for Update
[[email protected] Packages]#

yum check-update检查可更新的程序

[[email protected] Packages]# yum check-update

3 查找和显示

yum info 显示包的信息

[[email protected] Packages]# yum info zsh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
Name        : zsh
Arch        : x86_64
Version     : 4.3.11
Release     : 4.el6.centos
Size        : 5.0 M
Repo        : installed
Summary     : A powerful interactive shell
URL         : http://zsh.sunsite.dk/
License     : BSD
Description : The zsh shell is a command interpreter usable as an interactive login
            : shell and as a shell script command processor.  Zsh resembles the ksh
            : shell (the Korn shell), but includes many enhancements.  Zsh supports
            : command line editing, built-in spelling correction, programmable
            : command completion, shell functions (with autoloading), a history
            : mechanism, and more.
[[email protected] Packages]#

yum list  显示指定程序包安装情况

[[email protected] Packages]# yum list zsh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
zsh.x86_64                                                                            4.3.11-4.el6.centos                                                                             installed
[[email protected] Packages]#

yum serach all 查看所有包的信息

[[email protected] Packages]# yum search all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
====================================================================================== N/S Matched: all =======================================================================================
PackageKit-debug-install.x86_64 : Facility to install debugging packages using PackageKit
alliance-doc.x86_64 : Alliance VLSI CAD Sytem - Documentations
alliance-libs.i686 : Alliance VLSI CAD Sytem - multilibs
alliance-libs.x86_64 : Alliance VLSI CAD Sytem - multilibs
ctan-kerkis-calligraphic-fonts.noarch : Kerkis Calligraphic Type1 fonts
eclipse-callgraph.x86_64 : C/C++ Call Graph Visualization Tool
yum.noarch : RPM package installer/updater/manager
yum-plugin-auto-update-debug-info.noarch : Yum plugin to enable automatic updates to installed debuginfo packages
yum-plugin-fs-snapshot.noarch : Yum plugin to automatically snapshot your filesystems during updates
yum-plugin-local.noarch : Yum plugin to automatically manage a local repo. of downloaded packages
yum-plugin-merge-conf.noarch : Yum plugin to merge configuration changes when installing packages
yum-plugin-show-leaves.noarch : Yum plugin which shows newly installed leaf packages
  Name and summary matches only, use "search all" for everything.
[[email protected] Packages]#

yum search 查看zsh包的详细信息:

[[email protected] Packages]# yum search zsh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
====================================================================================== N/S Matched: zsh =======================================================================================
autojump-zsh.noarch : Autojump for zsh
docker-io-zsh-completion.x86_64 : zsh completion files for docker
gromacs-zsh.noarch : GROMACS zsh support
python-twisted-core-zsh.x86_64 : Tab completion for Zsh and Twisted Core
zsh-html.x86_64 : Zsh shell manual in html format
zsh.x86_64 : A powerful interactive shell
zsh-lovers.noarch : A collection of tips, tricks and examples for the Z shell
  Name and summary matches only, use "search all" for everything.
[[email protected] Packages]#

yum repolist 显示系统配置源的情况

[[email protected] ~]# yum repolist all
Loaded plugins: aliases, auto-update-debuginfo, changelog, dellsysid, fastestmirror, filter-data, fs-snapshot, keys, list-data, local, merge-conf, post-transaction-actions, presto,
              : priorities, protectbase, ps, remove-with-leaves, rpm-warm-cache, security, show-leaves, tmprepo, tsflags, upgrade-helper, verify, versionlock
Loading mirror speeds from cached hostfile
0 packages excluded due to repository protections
repo id                                                                             repo name                                                                                   status
C6.0-base                                                                           CentOS-6.0 - Base                                                                           disabled
C6.0-centosplus                                                                     CentOS-6.0 - CentOSPlus                                                                     disabled
C6.0-contrib                                                                        CentOS-6.0 - Contrib                                                                        disabled
C6.0-extras                                                                         CentOS-6.0 - Extras                                                                         disabled
C6.0-updates                                                                        CentOS-6.0 - Updates                                                                        disabled
C6.1-base                                                                           CentOS-6.1 - Base                                                                           disabled
C6.1-centosplus                                                                     CentOS-6.1 - CentOSPlus                                                                     disabled
C6.1-contrib                                                                        CentOS-6.1 - Contrib                                                                        disabled
C6.1-extras                                                                         CentOS-6.1 - Extras                                                                         disabled
C6.1-updates                                                                        CentOS-6.1 - Updates                                                                        disabled
C6.2-base                                                                           CentOS-6.2 - Base                                                                           disabled
C6.2-centosplus                                                                     CentOS-6.2 - CentOSPlus                                                                     disabled
C6.2-contrib                                                                        CentOS-6.2 - Contrib                                                                        disabled
C6.2-extras                                                                         CentOS-6.2 - Extras                                                                         disabled
C6.2-updates                                                                        CentOS-6.2 - Updates                                                                        disabled
C6.3-base                                                                           CentOS-6.3 - Base                                                                           disabled
C6.3-centosplus                                                                     CentOS-6.3 - CentOSPlus                                                                     disabled
C6.3-contrib                                                                        CentOS-6.3 - Contrib                                                                        disabled
C6.3-extras                                                                         CentOS-6.3 - Extras                                                                         disabled
C6.3-updates                                                                        CentOS-6.3 - Updates                                                                        disabled
C6.4-base                                                                           CentOS-6.4 - Base                                                                           disabled
C6.4-centosplus                                                                     CentOS-6.4 - CentOSPlus                                                                     disabled
C6.4-contrib                                                                        CentOS-6.4 - Contrib                                                                        disabled
C6.4-extras                                                                         CentOS-6.4 - Extras                                                                         disabled
C6.4-updates                                                                        CentOS-6.4 - Updates                                                                        disabled
C6.5-base                                                                           CentOS-6.5 - Base                                                                           disabled
C6.5-centosplus                                                                     CentOS-6.5 - CentOSPlus                                                                     disabled
C6.5-contrib                                                                        CentOS-6.5 - Contrib                                                                        disabled
C6.5-extras                                                                         CentOS-6.5 - Extras                                                                         disabled
C6.5-updates                                                                        CentOS-6.5 - Updates                                                                        disabled
C6.6-base                                                                           CentOS-6.6 - Base                                                                           disabled
C6.6-centosplus                                                                     CentOS-6.6 - CentOSPlus                                                                     disabled
C6.6-contrib                                                                        CentOS-6.6 - Contrib                                                                        disabled
C6.6-extras                                                                         CentOS-6.6 - Extras                                                                         disabled
C6.6-updates                                                                        CentOS-6.6 - Updates                                                                        disabled
Fedora-epel                                                                         Fedora-epel                                                                                 enabled: 11,765
base-debuginfo                                                                      CentOS-6 - Debuginfo                                                                        disabled
c6-media                                                                            CentOS-6 - Media                                                                            disabled
centos                                                                              Centos aliyun                                                                               enabled:  6,575
fasttrack                                                                           CentOS-6 - fasttrack                                                                        disabled
repolist: 18,340
[[email protected] ~]#

4.删除程序

yum remove

[[email protected] Packages]# yum remove wget
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.12-5.el6_6.1 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================================================================================================================
 Package                                   Arch                                        Version                                              Repository                                    Size
===============================================================================================================================================================================================
Removing:
 wget                                      x86_64                                      1.12-5.el6_6.1                                       @centos                                      1.8 M
Transaction Summary
===============================================================================================================================================================================================
Remove        1 Package(s)
Installed size: 1.8 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : wget-1.12-5.el6_6.1.x86_64                                                                                                                                                  1/1 
  Verifying  : wget-1.12-5.el6_6.1.x86_64                                                                                                                                                  1/1 
Removed:
  wget.x86_64 0:1.12-5.el6_6.1                                                                                                                                                                 
Complete!

yum deplist  查看程序依赖情况

5.清除缓存

yum clean all 清除缓存目录下的软件包

[[email protected] Packages]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: Fedora-epel centos
Cleaning up Everything
Cleaning up list of fastest mirrors
[[email protected] Packages]#

yum makecache 建立缓存

[[email protected] Packages]# yum makecache

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Fedora-epel                                                                                                                                                             | 4.3 kB     00:00    
centos                                                                                                                                                                  | 3.7 kB     00:00    
Metadata Cache Created
[[email protected] Packages]#

6.包组管理

yum grouplist 列出所有的包组

[[email protected] Packages]#  yum grouplist
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
Installed Groups:
   Additional Development
   Development tools
   E-mail server
   Fonts
   General Purpose Desktop
   Graphical Administration Tools
   Input Methods
   Legacy X Window System compatibility
   Milkymist
   Networking Tools
   Perl Support
   Security Tools
Installed Language Groups:
   Chinese Support [zh]
Available Groups:
省略
.
.
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
[[email protected] Packages]#

yum groupinfo 显示包组内具体信息

[[email protected] Packages]# yum groupinfo  "Development tools"
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
Group: Development tools
Description: A basic development environment.
Mandatory Packages:
   autoconf
   automake
   binutils
   bison
   flex
   gcc
   gcc-c++
   gettext
   libtool
   make
   patch
   pkgconfig
   redhat-rpm-config
   rpm-build
Default Packages:
trac-git-plugin
   trac-mercurial-plugin
   trac-webadmin
   translate-toolkit
[[email protected] Packages]#

yum groupinstall 安装包组

[[email protected] Packages]# yum groupinstall  ‘Development tools‘
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
Package flex-2.5.35-9.el6.x86_64 already installed and latest version
Package gcc-4.4.7-16.el6.x86_64 already installed and latest version
Package autoconf-2.63-5.1.el6.noarch already installed and latest version
Package redhat-rpm-config-9.0.3-44.el6.centos.noarch already installed and latest version
Package rpm-build-4.8.0-47.el6.x86_64 already installed and latest version
Package git-1.7.1-3.el6_4.1.x86_64 already installed and latest version
Package cscope-15.6-6.el6.x86_64 already installed and latest version
Package swig-1.3.40-6.el6.x86_64 already installed and latest version
Warning: Group development does not have any packages.
No packages in any requested group available to install or update
[[email protected] Packages]#

yum groupremove 卸载包组

[[email protected] Packages]# yum groupremove "Development tools"
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.63-5.1.el6 will be erased
---> Package automake.noarch 0:1.11.1-4.el6 will be erased
---> Package binutils.x86_64 0:2.20.51.0.2-5.43.el6 will be erased
--> Processing Dependency: binutils for package: module-init-tools-3.9-25.el6.x86_64
---> Package bison.x86_64 0:2.4.1-5.el6 will be erased
---> Package byacc.x86_64 0:1.9.20070509-7.el6 will be erased
省略
.
.
---> Package libselinux-devel.x86_64 0:2.0.94-5.8.el6 will be erased
---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be erased
---> Package pcre-devel.x86_64 0:7.8-7.el6 will be erased
---> Package rsyslog.x86_64 0:5.8.10-10.el6_6 will be erased
---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be erased
--> Processing Dependency: /sbin/new-kernel-pkg for package: kernel-2.6.32-573.el6.x86_64
Skipping the running kernel: kernel-2.6.32-573.el6.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
--> Finished Dependency Resolution
Error: Trying to remove "yum", which is protected
[[email protected] Packages]#
时间: 2024-10-12 21:19:49

20150910 课后练习 RPM YUM的相关文章

+++++++rpm/yum/编译

程序包管理总结 编译总结 程序包管理总结 rpm (Redhat Package Manager)早期由redhat用perl语言研发,后来用C重写 (RPM is Package Manager).前端管理工具是yum,centos 7后支持dnf(EPEL源) Fedora 22之后,支持dnf工具的使用 Debian系用.deb包,dpt-get前端管理工具 Slackware的二次发行版: 前端管理工具: Zypper,YasT 程序包命名 二进制格式: testapp-1.2.3-1.

程序包管理:RPM YUM的总结

程序包管理:RPM YUM的总结 一.RPM的简介 RPM 是RPM Package Manager(RPM软件包管理器)的缩写,这一文件格式名称虽然打上了RedHat的标志,但是其原始设计理念是开放式的,现在包括OpenLinux.S.u.S.E.以及Turbo Linux等Linux的分发版本都有采用,是公认的行业标准. 二.RPM程序包管理的用途 1.可以安装.删除.升级和管理软件:当然也支持在线安装和升级软件: 2.通过RPM包管理能知道软件包包含哪些文件,也能知道系统中的某个文件属于哪

跟马哥学linux (lesson 6)linux包管理程序rpm & yum

一.rpm 1.什么是RPM RPM 是 Red Hat Package Manager 的缩写,本意是Red Hat 软件包管理,顾名思义是Red Hat 贡献出来的软件包管理:在Fedora .Redhat.Mandriva.SuSE.YellowDog等主流发行版本,以及在这些版本基础上二次开发出来的发行版采用. 2.rpm语法格式 1)查询,验证           rpm {-q|--query} [select-options] [query-options] rpm {-V|--v

程序包管理:rpm&yum命令

1.软件包管理简介 Windows中所有的软件包都不可以直接在linux系统中直接安装使用. linux系统中软件包分类: 源码包(脚本安装包) 源代码直接开放的包,绝大部分是C语言写的: 二进包(源码包编译之后的包.RPM包.系统默认包) 优点:安装快速,简化安装过程但不能看到源代码,例如qq等: redhad系列和ubanto系列最大的区别就是二进制软件包不同,rehad用的二进制包是.rpm包,debin系列用的是deb包,其余的部分两种发行版本基本一致. 源码包的优点: 开源,可以修改源

rpm/yum/源码包编译等操作说明

rpm/yum/编译 RPM篇: RPM是RedHat Package Manager(RedHat软件包管理工具)其作用相当于Windows里面的"添加/删除程序. RPM包的一般格式为: name-version-arch.rpm name-version-arch.src.rpm   name:软件包名称. version:带有主.次和修订的软件包版本. arch:硬件平台.硬件平台包括了:i386.i486.i586.i686.x86_64.ppc.sparc.alpha src.rpm

2015年9月10日课程作业【程序包管理:rpm, yum】_JY1506402-19+liuhui880818

<Linux系统管理> (1)磁盘和文件系统管理: (2)RAID, LVM; btrfs; (3)程序包管理:rpm, yum(dnf) (4)Linux的网络管理; (5)进程和作业管理:htop, glances, tsar: (6)sed和awk: (7)Linux系统的开机启动流程: (8)内核基础知识,内核定制编译: (9)系统安装:kickstart, pxe 一.作业(练习)内容: 1.总结rpm和yum实现程序包的管理功能. 要求:作业要图文并茂 二.完成时间: 2015年9

L6 linux,rpm,yum详细使用

linux,rpm,yum详细使用说明 本文对linux包管理工具,rpm,yum做详细使用说明. 一,RPM软件包管理器 介绍: 什么是RPM包管理器 RPM是RPM Package Manager(RPM软件包管理器)的缩写,这一文件格式名称虽然打上了RedHat的标志,但是其原始设计理念是开放式的,现在包括OpenLinux.S.u.S.E.以及Turbo Linux等Linux的分发版本都有采用,可以算是公认的行业标准了. rpm的作用 打包,包管理(安装.升级.卸载.查询及校验) rp

程序包管理rpm,yum用法解析及自动化部署apache server实战,让您轻松拥有apache网站!

程序包管理器rpm,yum用法及apache httpd服务的自动化部署 程序包管理? 通常来说在windows中将需要安装的程序,程序名.exe下载下来然后点击setup的安装程序或直接点击程序包,下一步下一步即可.而Linux中程序包不是exe,不同的主流发行版有着不同的程序包管理机制.比较主流的主要是rpm程序包管理器和deb程序包管理. 这里要区别: 包名(PACKAGEFILE): rpm包程序文件的全名程序名(PACKAGENAME): rpm包不带版本号的程序名,比如QQ而不是QQ

yum no module name rpm/yum(CentOs6.5)

因為需要運行goagent,所以要安裝python2.7.3(原本的python版本是2.6.6).但是在我安裝python2.7.3之後,yum不能用了.也./usr/bin/yum把開頭( #!/usr/bin/python)改成 #!/usr/bin/python2.6.但是發現還是不能用.在命令窗里輸入:yum,它總提示:no module name yum.然後我在google中找了很多網頁一一嘗試. 下面是我在 酷學園發表的提問,結果後來自己解決了問題.所以直接把它複製到此. 我的C