Linux常见的软件包分为两种:源代码包(Source Code)、二进制包(Binary Code);源代码包是没有经过编译的包,需要经过GCC、C++编译器环境才能运行,二进制包无需编译,可直接安装使用。
rpm 二进制包说明:
vsftpd-3.0.2-21.e17.x86_64.rpm
vsftpd 包名称/软件名
3.0.2 版本号
21 小版本号
e17 给哪个系统使用 (el6 表示centos6使用 el7表示centos7使用)
x86_64 系统架构 i386(32位) x86_64(64位)
rpm 包名后缀名
使用RPM工具可以对软件包进行快速安装、卸载、修复、更新、查询。
1、安装
-ivh 安装软件包
--force 强制安装
--nodeps 忽略依赖关系
2、卸载
-e 卸载软件包
3、修复
rpm -ivh 包名 --replacepkgs
4、更新
rpm -Uvh 升级软件包
5、查询
查询软件是否安装
rpm -q vsftpd
-q 准确查询
-qa 全名查询
高级命令
》》查询列出所有配置文件
rpm -qc vsftpd
/etc/logrotate.d/vsftpd
/etc/pam.d/vsftpd
/etc/vsftpd/ftpusers
/etc/vsftpd/user_list
/etc/vsftpd/vsftpd.conf
》》查询列出软件包中的所有文件清单
rpm -ql vsftpd
/etc/logrotate.d/vsftpd
/etc/pam.d/vsftpd
/etc/vsftpd
/etc/vsftpd/ftpusers
/etc/vsftpd/user_list
/etc/vsftpd/vsftpd.conf
/etc/vsftpd/vsftpd_conf_migrate.sh
/usr/lib/systemd/system-generators/vsftpd-generator
/usr/lib/systemd/system/vsftpd.service
/usr/lib/systemd/system/vsftpd.target
/usr/lib/systemd/system/vsftpd@.service
/usr/sbin/vsftpd
/usr/share/doc/vsftpd-3.0.2
/usr/share/doc/vsftpd-3.0.2/AUDIT
/usr/share/doc/vsftpd-3.0.2/BENCHMARKS
/usr/share/doc/vsftpd-3.0.2/BUGS
/usr/share/doc/vsftpd-3.0.2/COPYING
/usr/share/doc/vsftpd-3.0.2/Changelog
/usr/share/doc/vsftpd-3.0.2/EXAMPLE
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE/README
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE/README.configuration
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE/vsftpd.conf
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE/vsftpd.xinetd
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE_NOINETD
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE_NOINETD/README
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE_NOINETD/README.configuration
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/INTERNET_SITE_NOINETD/vsftpd.conf
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/PER_IP_CONFIG
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/PER_IP_CONFIG/README
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/PER_IP_CONFIG/README.configuration
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/PER_IP_CONFIG/hosts.allow
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/README
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_HOSTS
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_HOSTS/README
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS/README
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS/README.configuration
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS/logins.txt
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS/vsftpd.conf
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS/vsftpd.pam
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS_2
/usr/share/doc/vsftpd-3.0.2/EXAMPLE/VIRTUAL_USERS_2/README
/usr/share/doc/vsftpd-3.0.2/FAQ
/usr/share/doc/vsftpd-3.0.2/INSTALL
/usr/share/doc/vsftpd-3.0.2/LICENSE
/usr/share/doc/vsftpd-3.0.2/README
/usr/share/doc/vsftpd-3.0.2/README.security
/usr/share/doc/vsftpd-3.0.2/REWARD
/usr/share/doc/vsftpd-3.0.2/SECURITY
/usr/share/doc/vsftpd-3.0.2/SECURITY/DESIGN
/usr/share/doc/vsftpd-3.0.2/SECURITY/IMPLEMENTATION
/usr/share/doc/vsftpd-3.0.2/SECURITY/OVERVIEW
/usr/share/doc/vsftpd-3.0.2/SECURITY/TRUST
/usr/share/doc/vsftpd-3.0.2/SIZE
/usr/share/doc/vsftpd-3.0.2/SPEED
/usr/share/doc/vsftpd-3.0.2/TODO
/usr/share/doc/vsftpd-3.0.2/TUNING
/usr/share/doc/vsftpd-3.0.2/vsftpd.xinetd
/usr/share/man/man5/vsftpd.conf.5.gz
/usr/share/man/man8/vsftpd.8.gz
/var/ftp
/var/ftp/pub
》》查询/验证文件属于的软件包
rpm -qf /etc/vsftpd/vsftpd.conf
vsftpd-3.0.2-22.el7.x86_64
》》查看软件安装后详细信息
rpm -qi vsftpd
Name : vsftpd Relocations: (not relocatable)
Version : 2.2.2 Vendor: CentOS
Release : 24.el6 Build Date: Wed 22 Mar 2017 08:14:03 PM CST
Install Date: Mon 28 Aug 2017 10:39:30 PM CST Build Host: c1bm.rdu2.centos.org
Group : System Environment/Daemons Source RPM: vsftpd-2.2.2-24.el6.src.rpm
Size : 348208 License: GPLv2 with exceptions
Signature : RSA/SHA1, Thu 23 Mar 2017 11:03:17 PM CST, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org>
URL : http://vsftpd.beasts.org/
Summary : Very Secure Ftp Daemon
Description :
vsftpd is a Very Secure FTP daemon. It was written completely from
scratch.
》》列出RPM软件包的描述信息
rpm -qpi vsftpd-3.0.2-21.e17.x86_64.rpm
[root@centos7 ~]# rpm -qp vsftpd-3.0.2-21.el7.x86_64.rpm
vsftpd-3.0.2-21.el7.x86_64
[root@centos7 ~]# rpm -qpi vsftpd-3.0.2-21.el7.x86_64.rpm
Name : vsftpd
Version : 3.0.2
Release : 21.el7
Architecture: x86_64
Install Date: (not installed)
Group : System Environment/Daemons
Size : 356228
License : GPLv2 with exceptions
Signature : RSA/SHA256, 2016年11月21日 星期一 04时58分43秒, Key ID 24c6a8a7f4a80eb5
Source RPM : vsftpd-3.0.2-21.el7.src.rpm
Build Date : 2016年11月06日 星期日 03时43分17秒
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem <http://bugs.centos.org>
Vendor : CentOS
URL : https://security.appspot.com/vsftpd.html
Summary : Very Secure Ftp Daemon
Description :
vsftpd is a Very Secure FTP daemon. It was written completely from
scratch.
》》查看RPM软件包的安装脚本
rpm -qp --scripts vsftpd-3.0.2-21.e17.x86_64.rpm
postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then
# Initial installation
systemctl preset vsftpd.service >/dev/null 2>&1 || :
fi
preuninstall scriptlet (using /bin/sh):
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable vsftpd.service > /dev/null 2>&1 || :
systemctl stop vsftpd.service > /dev/null 2>&1 || :
fi
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
systemctl --no-reload disable vsftpd.target > /dev/null 2>&1 || :
systemctl stop vsftpd.target > /dev/null 2>&1 || :
fi
postuninstall scriptlet (using /bin/sh):
systemctl daemon-reload >/dev/null 2>&1 || :
if [ $1 -ge 1 ] ; then
# Package upgrade, not uninstall
systemctl try-restart vsftpd.service >/dev/null 2>&1 || :
fi