天天看點

軟體管理rpm

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

gzip-1.3.5-13.el5.centos

bzip2-devel-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 <[email protected]>

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

[root@desktop7 ~]# rpm -qd zip

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 <[email protected]> - 2.31-2

- resolves: #371041

  zip does not honor umask setting

* thu jul 13 2006 jesse keating <[email protected]> - 2.31-1.2.2

- rebuild

* sat feb 11 2006 jesse keating <[email protected]> - 2.31-1.2.1

- bump again for double-long bug on ppc(64)

* wed feb 08 2006 jesse keating <[email protected]> - 2.31-1.2

- rebuilt for new gcc4.1 snapshot and glibc changes

* sat dec 10 2005 jesse keating <[email protected]>

- rebuilt

* fri nov 11 2005 ivana varekova <[email protected]> 2.31-1

- update to 2.31

* tue mar 08 2005 ivana varekova <[email protected]> 2.3-30

* tue jan 18 2005 ivana varekova <[email protected]> 2.3-29

- fix bug #142237 - problem with -d and ./files containing archives

* tue jun 22 2004 lon hohberger <[email protected]> 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 <[email protected]>

* sat mar 20 2004 lon hohberger <[email protected]> 2.3-22

- fix typos

* wed feb 18 2004 lon hohberger <[email protected]> 2.3-21

- include license file per bugzilla #116004

* sat feb 14 2004 elliot lee <[email protected]>

* tue dec 23 2003 lon hohberger <[email protected]> 2.3-19

- make temp file have umask 0066 mode (#112516)

* sat oct 25 2003 lon hohberger <[email protected]> 2.3-18

- incorporate arjan's exec-shield patch for i386

* thu jun 05 2003 elliot lee <[email protected]>

* thu jan 23 2003 tim powers <[email protected]>

* fri dec 20 2002 tim powers <[email protected]>

- bump and rebuild

* sat jun 22 2002 tim powers <[email protected]>

- automated rebuild

* fri may 24 2002 tim powers <[email protected]>

* wed apr 03 2002 trond eivind glomsrd <[email protected]>

- don't strip explicitly

* thu mar 14 2002 trond eivind glomsrd <[email protected]> 2.3-11

- add url

* mon jun 25 2001 elliot lee <[email protected]>

- bump release + rebuild.

* sat aug 26 2000 bill nottingham <[email protected]>

- add encryption code (#16878)

* fri jul 14 2000 prospector <[email protected]>

- automatic rebuild

* mon jun 12 2000 bill nottingham <[email protected]>

- rebuild in new environment

* tue mar 14 2000 bill nottingham <[email protected]>

- spec file cleanups (#10143)

* tue feb 08 2000 bill nottingham <[email protected]>

- fix some perms

* thu feb 03 2000 cristian gafton <[email protected]>

- fix description

- man pages are compressed

* wed jan 12 2000 bill nottingham <[email protected]>

- update to 2.3

* sat jul 31 1999 bill nottingham <[email protected]>

- update to 2.2

* mon mar 22 1999 cristian gafton <[email protected]>

- auto rebuild in the new build environment (release 8)

* fri mar 19 1999 cristian gafton <[email protected]>

- updated text in the spec file

* sat jan 16 1999 cristian gafton <[email protected]>

- patch top build on the arm

* tue dec 22 1998 michael maher <[email protected]>

- built package for 6.0

* tue aug 11 1998 jeff johnson <[email protected]>

- build root

* sat may 09 1998 prospector system <[email protected]>

- translations modified for de, fr, tr

* fri jul 11 1997 erik troan <[email protected]>

- built against glibc

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)  

9、查詢檔案提供者

[root@desktop7 ~]# rpm -q --file /bin/ls

coreutils-5.97-34.el5

二、安裝軟體包

安裝失敗,如何進行?

[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 ~]# rpm -qc vim-enhanved

[root@desktop7 ~]# rpm -qf vim-enhanved

error: file /root/vim-enhanved: no such file or directory

[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

三、更新與更新軟體包

四、解除安裝軟體包

五、檢驗軟體包變化狀态

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

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、檢視最後異動時間

-rwxr-xr-x 1 root root 230464 mar  3 05:50 /bin/tar

8、檢視變化情況

.......t    /bin/tar