rpm-q --changelog PACKAGE_NAME # rpm -q --changelog zsh * 四 11月 05 2015 Kamil Dudka <[email protected]> - 5.1.1-3 - make loading of module's dependencies work again (#1277996) * 四 10月 08 2015 Kamil Dudka <[email protected]> - 5.1.1-2 - fix crash in ksh mode with -n and $HOME (#1269883) * 一 9月 14 2015 Kamil Dudka <[email protected]> - 5.1.1-1 - Update to latest upstream release: Zsh 5.1.1 * 一 8月 31 2015 Kamil Dudka <[email protected]> - 5.1-1 - Update to latest upstream release: Zsh 5.1 - remove outdated workarounds in %check * 四 7月 30 2015 Kamil Dudka <[email protected]> - 5.0.8-6 - fix handling of command substitution in math context * 三 7月 22 2015 Kamil Dudka <[email protected]> - 5.0.8-5 - prevent infinite recursion in ihungetc() (#1245712) * 二 7月 07 2015 Kamil Dudka <[email protected]> - 5.0.8-4 - backport completion for dnf (#1239337) * 四 7月 02 2015 Kamil Dudka <[email protected]> - 5.0.8-3 - backport completion-related upstream fixes (#1238544) * 五 6月 19 2015 Fedora Release Engineering <[email protected]> - 5.0.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * 三 6月 03 2015 Kamil Dudka <[email protected]> - 5.0.8-1 - Update to latest upstream release: Zsh 5.0.8 * 五 5月 22 2015 Kamil Dudka <[email protected]> - 5.0.7-8 - fix SIGSEGV of the syntax check in ksh emulation mode (#1222867) * 一 4月 20 2015 Kamil Dudka <[email protected]> - 5.0.7-7 - fix SIGSEGV when handling heredocs and keyboard interrupt (#972624) - queue signals when manipulating global state to avoid deadlock * 日 1月 25 2015 Kamil Dudka <[email protected]> - 5.0.7-6 - use correct allocation function in the new 'cd' code (#1183238) * 五 1月 23 2015 Kamil Dudka <[email protected]> - 5.0.7-5 - suppress a warning about closing an already closed file descriptor (#1184002) - improve handling of NULL in the 'cd' built-in (#1183238) * 三 11月 19 2014 Kamil Dudka <[email protected]> - 5.0.7-4 - update documentation of POSIX_JOBS in the zshoptions.1 man page (#1162198) * 二 11月 18 2014 Kamil Dudka <[email protected]> - 5.0.7-3 - replace an incorrect comment in /etc/zshenv (#1164313) * 一 11月 10 2014 Kamil Dudka <[email protected]> - 5.0.7-2 - make the wait built-in work for already exited processes (#1162198) * 三 10月 08 2014 Dominic Hopf <[email protected]> - 5.0.7-1 - Update to latest upstream release: Zsh 5.0.7 * 四 8月 28 2014 Dominic Hopf <[email protected]> - 5.0.6-1 - Update to latest upstream release: Zsh 5.0.6 * 一 8月 18 2014 Fedora Release Engineering <[email protected]> - 5.0.5-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * 四 7月 17 2014 Dominic Hopf <[email protected]> - 5.0.5-7 - apply upstream patch which fixes CPU load issue (RHBZ#1120424) * 三 7月 09 2014 Adam Jackson <[email protected]> 5.0.5-6 - Fix missing 'fi' in %post * 四 7月 03 2014 Dominic Hopf <[email protected]> - 5.0.5-5 - improve handling of /etc/shells * 三 7月 02 2014 Dominic Hopf <[email protected]> - 5.0.5-4 - fix FTBFS issue (RHBZ#1106713) - remove individual _bindir setting; install to /usr/bin/ (RHBZ#1034060) - require info package instead of /sbin/install-info binary * 六 6月 07 2014 Fedora Release Engineering <[email protected]> - 5.0.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * 二 4月 08 2014 Dominic Hopf <[email protected]> - 5.0.5-1 - Update to latest upstream release: Zsh 5.0.5 * 四 1月 16 2014 James Antill <[email protected]> - 5.0.2-8 - Remove unneeded build require on tetex. * 六 10月 26 2013 Dominic Hopf <[email protected]> - 5.0.2-7 - Require hostname package instead of /bin/hostname * 二 10月 22 2013 Dominic Hopf <[email protected]> - 5.0.2-6 - remove systemd completion, it delivers it's own now (RHBZ#1022039) * 四 8月 01 2013 Dominic Hopf <[email protected]> - 5.0.2-5 - update systemd completion (adds machinectl command) * 二 6月 25 2013 Dominic Hopf <[email protected]> - 5.0.2-4 - up-to-date systemd completion (#949003) - apply patch for building for aarch64 (#926864) * 一 4月 15 2013 James Antill <[email protected]> - 5.0.2-3 - Fix the changelog dates. - Fix the texi itemx bug. - Resolves: bug#927863 * 五 2月 15 2013 Fedora Release Engineering <[email protected]> - 5.0.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * 二 1月 08 2013 Dominic Hopf <[email protected]> - 5.0.2-1 - Update to new upstream version: Zsh 5.0.2 * 三 11月 21 2012 Dominic Hopf <[email protected]> - 5.0.0-1 - Update to new upstream version: Zsh 5.0.0 * 日 7月 22 2012 Fedora Release Engineering <[email protected]> - 4.3.17-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * 日 3月 04 2012 Dominic Hopf <[email protected]> - 4.3.17-1 - Update to new upstream version: Zsh 4.3.17 * 六 1月 14 2012 Fedora Release Engineering <[email protected]> - 4.3.15-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * 六 12月 24 2011 Dominic Hopf <[email protected]> - 4.3.15-1 - Update to new upstream version: Zsh 4.3.15 * 六 12月 17 2011 Dominic Hopf <[email protected]> - 4.3.14-2 - change the License field to MIT (RHBZ#768548) * 六 12月 10 2011 Dominic Hopf <[email protected]> - 4.3.14-1 - Update to new upstream version: Zsh 4.3.14 * 六 12月 03 2011 Dominic Hopf <[email protected]> - 4.3.13-1 - Update to new upstream version: Zsh 4.3.13 * 六 8月 13 2011 Dominic Hopf <[email protected]> - 4.3.12-1 - Update to new upstream version: Zsh 4.3.12 * 二 2月 08 2011 Fedora Release Engineering <[email protected]> - 4.3.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * 四 1月 20 2011 Christopher Ailon <[email protected]> - 4.3.11-1 - Rebase to upstream version 4.3.11 * 二 12月 07 2010 Toshio Kuratomi <[email protected]> - 4.3.10-6 - Rebuild for FTBFS https://bugzilla.redhat.com/show_bug.cgi?id=631197 - Remove deprecated PreReq, the packages aren't needed at runtime and they're already in Requires(post,preun,etc): lines. * 一 3月 22 2010 James Antill <[email protected]> - 4.3.10-5 - Add pathmunge to our /etc/zshrc, for profile.d compat. - Resolves: bug#548960 * 五 8月 07 2009 James Antill <[email protected]> - 4.3.10-4 - Allow --excludedocs command to work! - Resolves: bug#515986 * 一 7月 27 2009 Fedora Release Engineering <[email protected]> - 4.3.10-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * 一 7月 20 2009 James Antill <[email protected]> - 4.3.10-1 - Import new upstream 4.3.10 * 三 6月 10 2009 Karsten Hopp <[email protected]> 4.3.9-4.1 - skip D02glob test on s390, too * 一 3月 02 2009 James Antill <[email protected]> - 4.3.9-4 - Remove D02glob testcase on ppc/ppc64, and hope noone cares * 三 2月 25 2009 Fedora Release Engineering <[email protected]> - 4.3.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
6、查詢某包提供的capabilities; rpm -q --provides PACKAGE_NAME; # rpm -q --provides zsh /bin/zsh config(zsh) = 5.1.1-3.fc24 zsh = 5.1.1-3.fc24 zsh(x86-64) = 5.1.1-3.fc24 7、查詢某包所依賴的capabilities;
rpm -q --requires PACKAGE_NAME # rpm -q --requires zsh /bin/sh /bin/sh /bin/sh /bin/sh /bin/zsh config(zsh) = 5.1.1-3.fc24 coreutils grep grep info info libc.so.6()(64bit) libc.so.6(GLIBC_2.11)(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.15)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libdl.so.2()(64bit) libdl.so.2(GLIBC_2.2.5)(64bit) libm.so.6()(64bit) libm.so.6(GLIBC_2.2.5)(64bit) libncursesw.so.6()(64bit) librt.so.1()(64bit) librt.so.1(GLIBC_2.2.5)(64bit) libtinfo.so.6()(64bit) rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(PayloadIsXz) <= 5.2-1 rtld(GNU_HASH)
8、查詢某包安裝或卸載時執行腳本;
rpm -q --scripts PACKAGE_NAME # rpm -q --scripts zsh \postinstall scriptlet (using /bin/sh): if [ "$1" = 1 ]; then if [ ! -f /etc/shells ] ; then echo "/usr/bin/zsh" > /etc/shells echo "/bin/zsh" >> /etc/shells else grep -q "^/usr/bin/zsh$" /etc/shells || echo "/usr/bin/zsh" >> /etc/shells grep -q "^/bin/zsh$" /etc/shells || echo "/bin/zsh" >> /etc/shells fi fi if [ -f /usr/share/info/zsh.info.gz ]; then # This is needed so that --excludedocs works. /sbin/install-info /usr/share/info/zsh.info.gz /usr/share/info/dir \ --entry="* zsh: (zsh).An enhanced bourne shell." fi preuninstall scriptlet (using /bin/sh): if [ "$1" = 0 ] ; then if [ -f /usr/share/info/zsh.info.gz ]; then # This is needed so that --excludedocs works. /sbin/install-info --delete /usr/share/info/zsh.info.gz /usr/share/info/dir \ --entry="* zsh: (zsh).An enhanced bourne shell." fi fi postuninstall scriptlet (using /bin/sh): if [ "$1" = 0 ] && [ -f /etc/shells ] ; then sed -i '\!^/usr/bin/zsh$!d' /etc/shells sed -i '\!^/bin/zsh$!d' /etc/shells fi
腳本有四類: preinstall:安裝過程開始之前執行的腳本; postinstall:安裝過程後執行的腳本; preuninstall:卸載前執行的腳本; postuninstall:卸載過程完成之後執行的腳本; 5.5 校驗 查詢包安裝之後生成的文件是否發生了改變 rpm {-V|--verify} [select-options] [verify-options] # rpm -V zsh S.5....T. c /etc/zshrc 常見用法:rpm -V PACKAGE_NAME S file Size differs M Mode differs (includes permissions and file type) 5 digest (formerly MD5 sum) differs D Device major/minor number mismatch L readLink(2) path mismatch U User ownership differs G Group ownership differs T mTime differs P caPabilities differ 程序包的合法性驗正: 來源合法: 由我們信任的制作者提供 依賴於:制作者的數字簽名;簽名是作者使用自己的私鑰加密程序包的特性碼進行的; 內容合法: 包未被二次修改;完整性校驗成功 依賴於:制作者提供的程序特征碼; 驗正方式:安裝者用同樣的特征碼提取算法提取程序包的特征碼,並與原作者提供的相比較; 驗正其光盤中程序包的來源及完整性: rpm --import /path/to/RPM-GPG-KEY-FILE 例如:# rpm --import RPM-GPG-KEY-CentOS-6 驗正:rpm {-K|--checksig} PACKAGE_FILE # rpm --import /misc/cd/RPM-GPG-KEY-CentOS-6 # rpm -K zsh-4.3.10-7.el6.x86_64.rpm zsh-4.3.10-7.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK # rpm -K php-5.3.3-38.el6.x86_64.rpm php-5.3.3-38.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK --nosignature: 不檢查來源合法性 --nodigest: 不檢查完整性 rpm管理器數據庫:/var/lib/rpm 重建數據庫: rpm {--initdb|--rebuilddb} [-v] [--dbpath DIRECTORY] --initdb: 初始化數據庫,即數據庫完全不存時,可新建之; 例如: 我刪除__db.001、__db.002、__db.003、__db.004
# rm -rf /var/lib/rpm/__db.00{1..4} # ll /var/lib/rpm/ 總用量 57208 -rw-r--r--. 1 root root 5083136 11月 19 15:32 Basenames -rw-r--r--. 1 root root12288 11月 10 15:20 Conflictname -rw-r--r--. 1 root root 1044480 11月 19 15:32 Dirnames -rw-r--r--. 1 root root 5263360 11月 19 15:32 Filedigests -rw-r--r--. 1 root root20480 11月 19 15:32 Group -rw-r--r--. 1 root root20480 11月 19 15:32 Installtid -rw-r--r--. 1 root root49152 11月 19 15:32 Name -rw-r--r--. 1 root root24576 11月 19 15:07 Obsoletename -rw-r--r--. 1 root root 46825472 11月 19 15:32 Packages -rw-r--r--. 1 root root 1343488 11月 19 15:32 Providename -rw-r--r--. 1 root root 696320 11月 19 15:32 Provideversion -rw-r--r--. 1 root root12288 11月 16 15:07 Pubkeys -rw-r--r--. 1 root root 446464 11月 19 15:32 Requirename -rw-r--r--. 1 root root 253952 11月 19 15:32 Requireversion -rw-r--r--. 1 root root90112 11月 19 15:32 Sha1header -rw-r--r--. 1 root root86016 11月 19 15:32 Sigmd5 -rw-r--r--. 1 root root12288 11月 10 15:20 Triggername # rpm --initdb /var/lib/rpm/ # ll /var/lib/rpm/ 總用量 58048 -rw-r--r--. 1 root root 5083136 11月 19 15:32 Basenames -rw-r--r--. 1 root root12288 11月 10 15:20 Conflictname -rw-r--r-- 1 root root24576 11月 19 15:38 __db.001 -rw-r--r-- 1 root root 229376 11月 19 15:38 __db.002 -rw-r--r-- 1 root root 1318912 11月 19 15:38 __db.003 -rw-r--r-- 1 root root 753664 11月 19 15:38 __db.004 -rw-r--r--. 1 root root 1044480 11月 19 15:32 Dirnames -rw-r--r--. 1 root root 5263360 11月 19 15:32 Filedigests -rw-r--r--. 1 root root20480 11月 19 15:32 Group -rw-r--r--. 1 root root20480 11月 19 15:32 Installtid -rw-r--r--. 1 root root49152 11月 19 15:32 Name -rw-r--r--. 1 root root24576 11月 19 15:07 Obsoletename -rw-r--r--. 1 root root 46825472 11月 19 15:32 Packages -rw-r--r--. 1 root root 1343488 11月 19 15:32 Providename -rw-r--r--. 1 root root 696320 11月 19 15:32 Provideversion -rw-r--r--. 1 root root12288 11月 16 15:07 Pubkeys -rw-r--r--. 1 root root 446464 11月 19 15:32 Requirename -rw-r--r--. 1 root root 253952 11月 19 15:32 Requireversion -rw-r--r--. 1 root root90112 11月 19 15:32 Sha1header -rw-r--r--. 1 root root86016 11月 19 15:32 Sigmd5 -rw-r--r--. 1 root root12288 11月 10 15:20 Triggername
--rebuilddb: 無論當前數據存在與否,都會直接重建此庫; 總結: 基本管理:安裝、升級、卸載、查詢和校驗; 合法性驗正; 數據庫管理;