Mac下 .rpm文件怎么安装

发布网友 发布时间:2022-02-26 09:36

我来回答

3个回答

热心网友 时间:2022-02-26 11:06

在Linux操作系统中,有一个系统软件包,它的功能类似于Windows里面的“添加/删除程序”,但是功能又比“添加/删除程序”强很多,它就是Red Hat Package Manager(简称RPM)。此工具包最先是由Red Hat公司推出的,后来被其他Linux开发商所借用。由于它为Linux使用者省去了很多时间,所以被广泛应用于在Linux下安装、删除软件。下面就给大家介绍一下它的具体使用方法。

  1.我们得到一个新软件,在安装之前,一般都要先查看一下这个软件包里有什么内容,假设这个文件是:Linux-1.4-6.i368.rpm,我们可以用这条命令查看:

  rpm -qpi Linux-1.4-6.i368.rpm
  系统将会列出这个软件包的详细资料,包括含有多少个文件、各文件名称、文件大小、创建时间、编译日期等信息。

  2.上面列出的所有文件在安装时不一定全部安装,就像Windows下程序的安装方式分为典型、完全、自定义一样,Linux也会让你选择安装方式,此时我们可以用下面这条命令查看软件包将会在系统里安装哪些部分,以方便我们的选择:
  rpm -qpl Linux-1.4-6.i368.rpm

  3.选择安装方式后,开始安装。我们可以用rpm-ivh Linux-1.4-6.i368.rpm命令安装此软件。在安装过程中,若系统提示此软件已安装过或因其他原因无法继续安装,但若我们确实想执行安装命令,可以在 -ivh后加一参数“-replacepkgs”:
  rpm -ivh -replacepkgs Linux-1.4-6.i368.rpm

  4.有时我们卸载某个安装过的软件,只需执行rpm-e <文件名>命令即可。

  5.对低版本软件进行升级是提高其功能的好办法,这样可以省去我们卸载后再安装新软件的麻烦,要升级某个软件,只须执行如下命令:rpm -uvh <文件名>,注意:此时的文件名必须是要升级软件的升级补丁
  6.另外一个安装软件的方法可谓是Linux的独到之处,同时也是RMP强大功能的一个表现:通过FTP站点直接在线安装软件。当找到含有你所需软件的站点并与此网站连接后,执行下面的命令即可实现在线安装,譬如在线安装Linux-1.4-6.i368.rpm,可以用命令:

  rpm -i ftp://ftp.pht.com/pub/linux/redhat/...-1.4-6.i368.rpm

  7.在我们使用电脑过程中,难免会有误操作,若我们误删了几个文件而影响了系统的性能时,怎样查找到底少了哪些文件呢?RPM软件包提供了一个查找损坏文件的功能,执行此命令:rpm -Va即可,Linux将为你列出所有损坏的文件。你可以通过Linux的安装光盘进行修复。

  8.Linux系统中文件繁多,在使用过程中,难免会碰到我们不认识的文件,在Windows下我们可以用“开始/查找”菜单快速判断某个文件属于哪个文件夹,在Linux中,下面这条命令行可以帮助我们快速判定某个文件属于哪个软件包:

  rpm -qf <文件名>

  9.当每个软件包安装在Linux系统后,安装文件都会到RPM数据库中“报到”,所以,我们要查询某个已安装软件的属性时,只需到此数据库中查找即可。注意:此时的查询命令不同于1和8介绍的查询,这种方法只适用于已安装过的软件包!命令格式:

  rpm -参数 <文件名>

在 Linux 操作系统下,几乎所有的软件均通过RPM 进行安装、卸载及管理等操作。RPM 的全称为Redhat Package Manager ,是由Redhat 公司提出的,用于管理Linux 下软件包的软件。Linux 安装时,除了几个核心模块以外,其余几乎所有的模块均通过RPM 完成安装。RPM 有五种操作模式,分别为:安装、卸载、升级、查询和验证。

RPM 安装操作

命令:

rpm -i 需要安装的包文件名

举例如下:

rpm -i example.rpm 安装 example.rpm 包;

rpm -iv example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息;

rpm -ivh example.rpm 安装 example.rpm 包并在安装过程中显示正在安装的文件信息及安装进度;

RPM 查询操作

命令:

rpm -q …

附加查询命令:

a 查询所有已经安装的包以下两个附加命令用于查询安装包的信息;

i 显示安装包的信息;

l 显示安装包中的所有文件被安装到哪些目录下;

s 显示安装版中的所有文件状态及被安装到哪些目录下;以下两个附加命令用于指定需要查询的是安装包还是已安装后的文件;

p 查询的是安装包的信息;

f 查询的是已安装的某文件信息;

举例如下:

rpm -qa | grep tomcat4 查看 tomcat4 是否被安装;

rpm -qip example.rpm 查看 example.rpm 安装包的信息;

rpm -qif /bin/df 查看/bin/df 文件所在安装包的信息;

rpm -qlf /bin/df 查看/bin/df 文件所在安装包中的各个文件分别被安装到哪个目录下;

RPM 卸载操作

命令:

rpm -e 需要卸载的安装包

在卸载之前,通常需要使用rpm -q …命令查出需要卸载的安装包名称。

举例如下:

rpm -e tomcat4 卸载 tomcat4 软件包

RPM 升级操作

命令:

rpm -U 需要升级的包

举例如下:

rpm -Uvh example.rpm 升级 example.rpm 软件包

RPM 验证操作

命令:

rpm -V 需要验证的包

举例如下:

rpm -Vf /etc/tomcat4/tomcat4.conf

输出信息类似如下:

S.5....T c /etc/tomcat4/tomcat4.conf

其中,S 表示文件大小修改过,T 表示文件日期修改过。限于篇幅,更多的验证信息请您参考rpm 帮助文件:man rpm

RPM 的其他附加命令

--force 强制操作 如强制安装删除等;
--requires 显示该包的依赖关系;
--nodeps 忽略依赖关系并继续操作

热心网友 时间:2022-02-26 12:24

这个问题我也遇到过,只不过提示的错误和你不一样,我的错误提示是:
/bin/sh is needed by wget-1.12-1.4.el6.x86_
/sbin/install-info is needed by wget-1.12-1.4.el6.x86_
libc.so.6()(bit) is needed by wget-1.12-1.4.el6.x86_
libc.so.6(GLIBC_2.11)(bit) is needed by wget-1.12-1.4.el6.x86_
libc.so.6(GLIBC_2.2.5)(bit) is needed by wget-1.12-1.4.el6.x86_
libc.so.6(GLIBC_2.3)(bit) is needed by wget-1.12-1.4.el6.x86_
libc.so.6(GLIBC_2.3.4)(bit) is needed by wget-1.12-1.4.el6.x86_
libc.so.6(GLIBC_2.4)(bit) is needed by wget-1.12-1.4.el6.x86_
libc.so.6(GLIBC_2.8)(bit) is needed by wget-1.12-1.4.el6.x86_
libcrypto.so.10()(bit) is needed by wget-1.12-1.4.el6.x86_
libdl.so.2()(bit) is needed by wget-1.12-1.4.el6.x86_
librt.so.1()(bit) is needed by wget-1.12-1.4.el6.x86_
librt.so.1(GLIBC_2.2.5)(bit) is needed by wget-1.12-1.4.el6.x86_
libssl.so.10()(bit) is needed by wget-1.12-1.4.el6.x86_
libz.so.1()(bit) is needed by wget-1.12-1.4.el6.x86_
rtld(GNU_HASH) is needed by wget-1.12-1.4.el6.x86_
/etc is needed by wget-1.12-1.4.el6.x86_
/usr/bin is needed by wget-1.12-1.4.el6.x86_
/usr/share/doc is needed by wget-1.12-1.4.el6.x86_
/usr/share/info is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/be/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/bg/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/ca/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/cs/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/da/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/de/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/el/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/en@boldquot/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/en@quot/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/en_GB/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/en_US/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/eo/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/es/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/et/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/eu/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/fi/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/fr/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/ga/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/gl/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/he/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/hr/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/hu/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/id/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/it/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/ja/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/lt/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/nb/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/nl/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/pl/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/pt/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/pt_BR/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/ro/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/ru/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/sk/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/sl/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/sr/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/sv/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/tr/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/uk/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/vi/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/zh_CN/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/locale/zh_TW/LC_MESSAGES is needed by wget-1.12-1.4.el6.x86_
/usr/share/man/man1 is needed by wget-1.12-1.4.el6.x86_

我的判断是,这个rpm命令是linux下的,mac貌似不能直接使用,rpm就是一个安装包的方法,肯定有其他替代方案

热心网友 时间:2022-02-26 13:58

rpm全称是redhat package manager,是Redhat Enterprise Linux 、Centos 、Fedora、OpenLinux、S.u.S.E.以及Turbo Linux等Linux系统发行版所用的软件包,你在mac中肯定不能直接用啊

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com