2013年3月3日 星期日 晴
软件管理
rpm
一、查询
1、查询已经安装的软件包
[root@desktop7 ~]# rpm -q zip
zip-2.31-2.el5
2、在所有的安装包中筛选包含zip字段的软件包
[root@desktop7 ~]# rpm -q --all |grep 'zip'
bzip2-libs-1.0.3-6.el5_5
zip-2.31-2.el5
gzip-1.3.5-13.el5.centos
bzip2-devel-1.0.3-6.el5_5
bzip2-libs-1.0.3-6.el5_5
bzip2-1.0.3-6.el5_5
unzip-5.52-3.el5
[root@desktop7 ~]#
3、查询zip软件包的详细信息
[root@desktop7 ~]# rpm -q --info zip
Name : zip Relocations: (not relocatable)
Version : 2.31 Vendor: CentOS
Release : 2.el5 Build Date: Thu 12 Mar 2009 04:34:27 AM CST
Install Date: Wed 27 Feb 2013 06:38:55 AM CST Build Host: chamkaur.karan.org
Group : Applications/Archiving Source RPM: zip-2.31-2.el5.src.rpm
Size : 318496 License: distributable
Signature : DSA/SHA1, Tue 17 Mar 2009 07:40:16 PM CST, Key ID a8a447dce8562897
Packager : Karanbir Singh <kbsingh@karan.org>
URL : http://www.info-zip.org/pub/infozip/Zip.html
Summary : A file compression and packaging utility compatible with PKZIP.
Description :
The zip program is a compression and file packaging utility. Zip is
analogous to a combination of the UNIX tar and compress commands and
is compatible with PKZIP (a compression and file packaging utility for
MS-DOS systems).
Install the zip package if you need to compress files using the zip
program.
4、查询zip软件包内容
[root@desktop7 ~]# rpm -q -l zip
/usr/bin/zip
/usr/bin/zipcloak
/usr/bin/zipnote
/usr/bin/zipsplit
/usr/share/doc/zip-2.31
/usr/share/doc/zip-2.31/BUGS
/usr/share/doc/zip-2.31/CHANGES
/usr/share/doc/zip-2.31/LICENSE
/usr/share/doc/zip-2.31/MANUAL
/usr/share/doc/zip-2.31/README
/usr/share/doc/zip-2.31/TODO
/usr/share/doc/zip-2.31/WHATSNEW
/usr/share/doc/zip-2.31/WHERE
/usr/share/doc/zip-2.31/algorith.txt
/usr/share/man/man1/zip.1.gz
5、查询zip软件包提供的文件(documentation)
[root@desktop7 ~]# rpm -q --docfiles zip
/usr/share/doc/zip-2.31/BUGS
/usr/share/doc/zip-2.31/CHANGES
/usr/share/doc/zip-2.31/LICENSE
/usr/share/doc/zip-2.31/MANUAL
/usr/share/doc/zip-2.31/README
/usr/share/doc/zip-2.31/TODO
/usr/share/doc/zip-2.31/WHATSNEW
/usr/share/doc/zip-2.31/WHERE
/usr/share/doc/zip-2.31/algorith.txt
/usr/share/man/man1/zip.1.gz
[root@desktop7 ~]#
[root@desktop7 ~]# rpm -qd zip
/usr/share/doc/zip-2.31/BUGS
/usr/share/doc/zip-2.31/CHANGES
/usr/share/doc/zip-2.31/LICENSE
/usr/share/doc/zip-2.31/MANUAL
/usr/share/doc/zip-2.31/README
/usr/share/doc/zip-2.31/TODO
/usr/share/doc/zip-2.31/WHATSNEW
/usr/share/doc/zip-2.31/WHERE
/usr/share/doc/zip-2.31/algorith.txt
/usr/share/man/man1/zip.1.gz
[root@desktop7 ~]#
6、查询zip软件包提供哪些配置文件(configfiles)
[root@desktop7 ~]# rpm -q --configfiles zip
[root@desktop7 ~]# rpm -qc zip
7、查询软件包的修改记录
[root@desktop7 ~]# rpm -q --changelog zip
* Wed Jul 09 2008 Ivana Varekova <varekova@redhat.com> - 2.31-2
- Resolves: #371041
zip does not honor umask setting
* Thu Jul 13 2006 Jesse Keating <jkeating@redhat.com> - 2.31-1.2.2
- rebuild
* Sat Feb 11 2006 Jesse Keating <jkeating@redhat.com> - 2.31-1.2.1
- bump again for double-long bug on ppc(64)
* Wed Feb 08 2006 Jesse Keating <jkeating@redhat.com> - 2.31-1.2
- rebuilt for new gcc4.1 snapshot and glibc changes
* Sat Dec 10 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Fri Nov 11 2005 Ivana Varekova <varekova@redhat.com> 2.31-1
- update to 2.31
* Tue Mar 08 2005 Ivana Varekova <varekova@redhat.com> 2.3-30
- rebuilt
* Tue Jan 18 2005 Ivana Varekova <varekova@redhat.com> 2.3-29
- Fix bug #142237 - problem with -d and ./files containing archives
* Tue Jun 22 2004 Lon Hohberger <lhh@redhat.com> 2.3-24
- Extend max file/archive size to 2^32-8193 (4294959103) bytes
- Include better debugging output for configure script
* Wed Jun 16 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Sat Mar 20 2004 Lon Hohberger <lhh@redhat.com> 2.3-22
- Fix typos
* Wed Feb 18 2004 Lon Hohberger <lhh@redhat.com> 2.3-21
- Include LICENSE file per bugzilla #116004
* Sat Feb 14 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Tue Dec 23 2003 Lon Hohberger <lhh@redhat.com> 2.3-19
- Make temp file have umask 0066 mode (#112516)
* Sat Oct 25 2003 Lon Hohberger <lhh@redhat.com> 2.3-18
- Incorporate Arjan's exec-shield patch for i386
* Thu Jun 05 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Thu Jan 23 2003 Tim Powers <timp@redhat.com>
- rebuilt
* Fri Dec 20 2002 Tim Powers <timp@redhat.com>
- bump and rebuild
* Sat Jun 22 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Fri May 24 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Wed Apr 03 2002 Trond Eivind Glomsrd <teg@redhat.com>
- Don't strip explicitly
* Thu Mar 14 2002 Trond Eivind Glomsrd <teg@redhat.com> 2.3-11
- Add URL
* Mon Jun 25 2001 Elliot Lee <sopwith@redhat.com>
- Bump release + rebuild.
* Sat Aug 26 2000 Bill Nottingham <notting@redhat.com>
- add encryption code (#16878)
* Fri Jul 14 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild
* Mon Jun 12 2000 Bill Nottingham <notting@redhat.com>
- rebuild in new environment
* Tue Mar 14 2000 Bill Nottingham <notting@redhat.com>
- spec file cleanups (#10143)
* Tue Feb 08 2000 Bill Nottingham <notting@redhat.com>
- fix some perms
* Thu Feb 03 2000 Cristian Gafton <gafton@redhat.com>
- fix description
- man pages are compressed
* Wed Jan 12 2000 Bill Nottingham <notting@redhat.com>
- update to 2.3
* Sat Jul 31 1999 Bill Nottingham <notting@redhat.com>
- update to 2.2
* Mon Mar 22 1999 Cristian Gafton <gafton@redhat.com>
- auto rebuild in the new build environment (release 8)
* Fri Mar 19 1999 Cristian Gafton <gafton@redhat.com>
- updated text in the spec file
* Sat Jan 16 1999 Cristian Gafton <gafton@redhat.com>
- patch top build on the arm
* Tue Dec 22 1998 Michael Maher <mike@redhat.com>
- built package for 6.0
* Tue Aug 11 1998 Jeff Johnson <jbj@redhat.com>
- build root
* Sat May 09 1998 Prospector System <bugs@redhat.com>
- translations modified for de, fr, tr
* Fri Jul 11 1997 Erik Troan <ewt@redhat.com>
- built against glibc
[root@desktop7 ~]#
8、查询软件包所需的组件
[root@desktop7 ~]# rpm -q --requires zip
libc.so.6()(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)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rtld(GNU_HASH)
[root@desktop7 ~]#
9、查询文件提供者
[root@desktop7 ~]# rpm -q --file /bin/ls
coreutils-5.97-34.el5
[root@desktop7 ~]#
二、安装软件包
安装失败,如何进行?
[root@desktop7 ~]# rpm -e vim-enhanced
[root@desktop7 ~]# rpm -q vim-enhanved
package vim-enhanved is not installed
[root@desktop7 ~]# rpm -ivh vim-enhanced
error: open of vim-enhanced failed: No such file or directory
[root@desktop7 ~]# rpm -qp vim-enhanved
error: open of vim-enhanved failed: No such file or directory
[root@desktop7 ~]#
[root@desktop7 ~]# rpm -qc vim-enhanved
package vim-enhanved is not installed
[root@desktop7 ~]# rpm -qf vim-enhanved
error: file /root/vim-enhanved: No such file or directory
[root@desktop7 ~]#
[root@desktop7 ~]# ll /etc/inittab
-rw-r--r-- 1 root root 1666 Feb 27 06:57 /etc/inittab
[root@desktop7 ~]# rpm -qf /etc/inittab
initscripts-8.45.42-1.el5.centos
[root@desktop7 ~]# rpm -qd /etc/inittab
package /etc/inittab is not installed
[root@desktop7 ~]#
三、升级与更新软件包
四、卸载软件包
五、检验软件包变化状态
1、查询软件
[root@desktop7 ~]# rpm -q tar
tar-1.15.1-31.el5
2、软件路径
[root@desktop7 ~]# whereis tar
tar: /bin/tar /usr/share/man/man1/tar.1.gz
3、软件提供者
[root@desktop7 ~]# rpm -qf /bin/tar
tar-1.15.1-31.el5
4、软件包现在状态
[root@desktop7 ~]# rpm -V tar
5、文件最后异动时间
[root@desktop7 ~]# ls -l /bin/tar
-rwxr-xr-x 1 root root 230464 Feb 24 2012 /bin/tar
6、修改异动时间
[root@desktop7 ~]# touch /bin/tar
7、查看最后异动时间
[root@desktop7 ~]# ls -l /bin/tar
-rwxr-xr-x 1 root root 230464 Mar 3 05:50 /bin/tar
8、查看变化情况
[root@desktop7 ~]# rpm -V tar
.......T /bin/tar
[root@desktop7 ~]#