CentOS下使用rpm 几个常用命令

前端之家收集整理的这篇文章主要介绍了CentOS下使用rpm 几个常用命令前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. 查看后缀 .rpm 文件的安装路径:

1)rpm -ql XXX 就可以看到XXX在系统的哪些位置

例如

# rpm -ql MysqL57-community-release-el7-9.noarch
/etc/pki/rpm-gpg/RPM-GPG-KEY-MysqL
/etc/yum.repos.d/MysqL-community-source.repo
/etc/yum.repos.d/MysqL-community.repo

2)rpm -qpl xxx.rpm 查看rpm 文件将会被安装在什么目录文件下。

例如:

# rpm -qpl anydesk-2.5.0-1.el7.x86_64.rpm 
/etc/xdg/autostart/anydesk.desktop
/usr/bin/anydesk
/usr/lib64/anydesk
/usr/lib64/anydesk/libgdkglext-x11-1.0.so.0
/usr/lib64/anydesk/libgdkglext-x11-1.0.so.0.0.0
/usr/lib64/anydesk/libgtkglext-x11-1.0.so.0
/usr/lib64/anydesk/libgtkglext-x11-1.0.so.0.0.0
/usr/lib64/anydesk/libpangox-1.0.so.0
/usr/lib64/anydesk/libpangox-1.0.so.0.0.0
/usr/libexec/anydesk
/usr/share/applications/anydesk.desktop
/usr/share/doc/anydesk-2.5.0
/usr/share/doc/anydesk-2.5.0/BUNDLED-LIBS
/usr/share/doc/anydesk-2.5.0/COPYING.LIB.gtkglext
/usr/share/doc/anydesk-2.5.0/COPYING.pangox-compat
/usr/share/doc/anydesk-2.5.0/README
/usr/share/doc/anydesk-2.5.0/copyright
/usr/share/icons/hicolor/16x16/apps/anydesk.png
/usr/share/icons/hicolor/24x24/apps/anydesk.png
/usr/share/icons/hicolor/256x256/apps/anydesk.png
/usr/share/icons/hicolor/32x32/apps/anydesk.png
/usr/share/icons/hicolor/48x48/apps/anydesk.png
/usr/share/icons/hicolor/scalable/apps/anydesk.svg
/usr/share/man/man1/anydesk.1.gz
/usr/share/pixmaps/anydesk.png
/usr/share/pixmaps/anydesk.xpm

2. 安装rpm文件

1)rpm -ivh xxxx.rpm 这是rpm的常用命令,这个应该不用解释了吧。。。


3. 卸载rpm 文件

1)先查找,rpm -qa 来进行查找看看文件是否被安装

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

例如:

# rpm -qa | grep MysqL
MysqL-community-server-5.7.16-1.el7.x86_64
MysqL-community-libs-5.7.16-1.el7.x86_64
MysqL57-community-release-el7-9.noarch
MysqL-community-client-5.7.16-1.el7.x86_64
MysqL-community-libs-compat-5.7.16-1.el7.x86_64
MysqL-community-common-5.7.16-1.el7.x86_64

2) 再卸载 rpm -e XXX 命令卸载

例如:

# rpm -e anydesk-2.5.0-1.el7.x86_64
原文链接:https://www.f2er.com/centos/376355.html

猜你在找的CentOS相关文章