美文网首页
linux rpm包

linux rpm包

作者: 咖啡di味道 | 来源:发表于2020-07-25 17:43 被阅读0次

    介绍

    rpm包是编译好的二进制软件包,类型Windows中的exe文件,分为rpm,srpm包。

    httpd.2.1.0-22-i386.rpm

    • httpd 软件包名
    • 2.1.0 软件版本
    • 22 发行次数
    • i386 适合的硬件平台,还有i686,x86-64,noarch 指可以通用。
    • rpm rpm 包标示。

    安装

    rpm - i [辅助选项] fle1.rpm,file2.rpm..

    -i , install 安装意思,
    file1.rpm 包名。
    辅助选项
    -v 显示附加信息
    -h 安装时输出标记#
    --test 安装测试,不进行实际安装
    --nodeps 不检查软件之间的依赖关系,
    --force 忽略软件包以及软件冲突
    --replacepkgs 强制重新安装已安装的软件包
    --prefix 将软件包安装到 prefix=路径 下。
    --percent 以百分比显示安装进度。
    --excludedocs
    --includedocs

    安装过程会出行各种依赖错误,根据安装提醒一个个解决安装依赖。
    常用命令

    rpm   -ivh  gcc-4.8.3.44.x86_64.rpm
    

    查询

    rpm -q [辅助选项] name1,name2

    -q ,query 查询到意思。
    name1,name1.., 为以安装到软件包查询。
    辅助选项
    -f 软某个文件属于哪个对应到包。
    -p,查询.rpm 包安装后对应到包名。
    -l ,显示软件包中所有到文件,后面跟需要查询到包名,不带.rpm 后缀。
    -i ,显示软件包到概要信息,后面加上软件包名。
    -g , 查询指定类别到软件包列表。
    -d ,显示软件包中说明文件列表,软件包内一般分三类型文件1配置文件,2说明文件,3可执行文件。
    -s
    -R
    --provides
    -查询某个软件包是否已安装

    rmp -q 包名 
    
    • 查询所有符合条件的已安装软件包
    rpm -qa | grep yum
    
    • 查询某个文件属于那个软件包
    [doudou@localhost ~]$ rpm -qf /bin/bash
    bash-4.2.46-28.el7.x86_64
    [doudou@localhost ~]$   
    
    • 查询软件包概要信息
    [doudou@localhost ~]$ rpm -qi bash
    Name        : bash
    Version     : 4.2.46
    Release     : 28.el7
    Architecture: x86_64
    Install Date: 2018年10月07日 星期日 22时31分38秒
    Group       : System Environment/Shells
    Size        : 3663637
    License     : GPLv3+
    Signature   : RSA/SHA256, 2017年08月10日 星期四 23时03分40秒, Key ID 24c6a8a7f4a80eb5
    Source RPM  : bash-4.2.46-28.el7.src.rpm
    Build Date  : 2017年08月03日 星期四 05时13分21秒
    Build Host  : c1bm.rdu2.centos.org
    Relocations : (not relocatable)
    Packager    : CentOS BuildSystem <http://bugs.centos.org>
    Vendor      : CentOS
    URL         : http://www.gnu.org/software/bash
    Summary     : The GNU Bourne Again shell
    Description :
    The GNU Bourne Again shell (Bash) is a shell or command language
    interpreter that is compatible with the Bourne shell (sh). Bash
    incorporates useful features from the Korn shell (ksh) and the C shell
    (csh). Most sh scripts can be run by bash without modification.
    
    • 查询软件包对应的文件
    [doudou@localhost ~]$ rpm -ql bash
    /etc/skel/.bash_logout
    /etc/skel/.bash_profile
    /etc/skel/.bashrc
    /usr/bin/alias
    

    验证软件包

    rpm -V [选项]

    -V 验证已安装的软件包和当初是否一至。
    -p ,验证软件包文件。

    rpm -V httpd
    

    更新软件包

    rpm -U [选项]

    rpm -U httpd
    

    删除软件包

    rpm -e [] 包名

    -- nodeps 不检查依赖
    -- test 只执行删除测试。

    rpm -e httpd
    

    相关文章

      网友评论

          本文标题:linux rpm包

          本文链接:https://www.haomeiwen.com/subject/hkctlktx.html