文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>How to install or updata RPM package ?

How to install or updata RPM package ?

时间:2009-03-23  来源:sjhf

In order to install an RPM package you must first have the RPM you are trying to install on your system. Many people will download RPMs from a website and of course, Red Hat Network (RHN) provides all the RPM packages included in our distributions. There are two main flags that are used to install or upgrade RPM packages:
  • -i is used to install a new package. Always use this for kernel installations and upgrades.
  • -U is used to upgrade an RPM package but will also install a package if it does not exist in the RPM database.
Usage and additional options can be found in the RPM man page. Type man rpm from the command line. Here is some information about the -i and -U flags:
   INSTALL AND UPGRADE OPTIONS
       The general form of an rpm install command is
 
       rpm {-i|--install} [install-options] PACKAGE_FILE ...
 
       This installs a new package.
 
       The general form of an rpm upgrade command is
 
       rpm {-U|--upgrade} [install-options] PACKAGE_FILE ...
 
       This install the package or upgrades the package currently installed  to  a  newer
       version.   This  is the same as install, except all other version(s) of
       the package are removed after the new package is installed.
     
Examples:
Note: These examples assume the packages are in a directory on your system. The below RPM commands are executed in the current working directory where the new RPM files reside.
  • To install an RPM package, we use of the -i flag. As mentioned before, you use this flag when you are installing a kernel RPM. In this case, you will want to leave your old kernel in place, at least temporarily, in case the new kernel does not boot. In this example, we first check to see the names of the new RPM packages with the ls command. Then we query the RPM database to see which kernel packages are already installed. You do not need to include the version number in the query, but the usage is: rpm -q <package name>. We can install the RPM package with the following command: rpm -ivh <package name>. Note the -v option will show verbose output and the -h will show the hash marks, which represents action of the progress of the RPM upgrade. Lastly, we run another RPM query to verify the package will be available.
·                # ls
·                 
·                kernel-2.4.21-15.0.2.EL
·                 
·                   1:kernel                 ########################################### [100%]
·                   1:kernel-smp             ########################################### [100%]
·                kernel-2.4.21-4.0.1.EL
·                kernel-smp-2.4.21-4.0.1.EL
·                 
·                mod_ssl-2.0.46-32.ent.3.i386.rpm
·                httpd-2.0.46-32.ent
·                # rpm -Uvh httpd-2.0.46-32.ent.3.i386.rpm mod_ssl-2.0.46-32.ent.3.i386.rpm
·                   2:mod_ssl                ########################################### [100%]
·                httpd-2.0.46-32.ent.3
·
相关阅读 更多 +
排行榜 更多 +
拉力竞速2

拉力竞速2

体育竞技 下载
文字乱舞水浒

文字乱舞水浒

角色扮演 下载
蓝图公考

蓝图公考

学习教育 下载