LINUX software packages to install, upgrade, delete

1, installation and upgrade a package rpm;

[root@localhost beinan]#rpm -vih file.rpm 注:这个是用来安装一个新的rpm 包;

[root@localhost beinan]#rpm -Uvh file.rpm 注:这是用来升级一个rpm 包;

If there are dependencies, resolve dependencies, in fact, the package manager can solve dependencies, see the previous package manager introduced; if you can not find dependencies in the package manager package; it would only compiles he relies package to resolve the dependency, or force the installation; grammatical structure:

[root@localhost beinan]# rpm -ivh file.rpm --nodeps --force

[root@localhost beinan]# rpm -Uvh file.rpm --nodeps --force

More parameters, see man rpm example application:

[root@localhost RPMS]# rpm -ivh lynx-2.8.5-23.i386.rpm

Preparing...                ########################################### [100%]

   1:lynx                   ########################################### [100%]

[root@localhost RPMS]# rpm -ivh --replacepkgs  lynx-2.8.5-23.i386.rpm

Preparing...                ########################################### [100%]

   1:lynx                   ########################################### [100%]

Note: --replacepkgs parameters based on installed software installation again; sometimes not much need; test installation parameters --test, used to check dependencies; not the real installation;

[root@localhost RPMS]# rpm -ivh --test  gaim-1.3.0-1.fc4.i386.rpm

Preparing...                ########################################### [100%]

Downgraded to a new version of the old version, and to raise --oldpackage parameters;

[root@localhost RPMS]# rpm -qa gaim

gaim-1.5.0-1.fc4

[root@localhost RPMS]# rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm

Preparing...                ########################################### [100%]

   1:gaim                   ########################################### [100%]

[root@localhost RPMS]# rpm -qa gaim

gaim-1.3.0-1.fc4

Specify the installation directory for the package: to add -relocate parameters; The following example is to specify gaim-1.3.0-1.fc4.i386.rpm installed in / opt / gaim directory;

[root@localhost RPMS]# rpm -ivh  --relocate /=/opt/gaim  gaim-1.3.0-1.fc4.i386.rpm

Preparing...                ########################################### [100%]

   1:gaim                   ########################################### [100%]

[root@localhost RPMS]# ls /opt/

gaim

Specify the installation directory for the package: to add -relocate parameters; The following example is to specify lynx-2.8.5-23.i386.rpm installed in / opt / lynx directory;

[root@localhost RPMS]# rpm -ivh --relocate /=/opt/lynx --badreloc lynx-2.8.5-23.i386.rpm

Preparing... ########################################### [100%]

1:lynx ########################################### [100%]

How do we program installed in the specified directory to call it? General execution of the program, are placed in the installation or bin directory sbin directory; see the example below; output if there is an error, to make the corresponding link, with ln -s;

[root@localhost RPMS]# /opt/lynx/usr/bin/lynx

Configuration file /etc/lynx.cfg is not available.

[root@localhost RPMS]# ln -s /opt/lynx/etc/lynx.cfg /etc/lynx.cfg

[root@localhost RPMS]# /opt/lynx/usr/bin/lynx www.linuxsir.org

RPM Package Manager management support and network installation inquiry;

For example, we want a mirror query Fedora Core 4.0, the installation package; Address:

http://mirrors.kernel.org/fedora/core/4/i386/os/Fedora/RPMS/ Example: Syntax:

rpm 参数 rpm包文件的http或者ftp的地址

# rpm -qpi http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm

# rpm  -ivh http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm

2, remove a rpm package;

First you have to learn to query the rpm package; see the previous description; [root @ localhost beinan] #rpm -e package name, for example: I want to remove lynx package, complete operation should be:

[root@localhost RPMS]# rpm -e lynx

If there are dependencies, you can also use --nodeps ignore dependent checking to delete. But try not to do that, the best package manager systerm-config-packages to add or delete software;

[root@localhost beinan]# rpm -e lynx --nodeps

RPM verification and digital certificates:

Import Signature:

[Root @ localhost RPMS] # rpm --import signature file, for example:

[root@localhost fc40]# rpm --import RPM-GPG-KEY

[root@localhost fc40]# rpm --import RPM-GPG-KEY-fedora

RPM verification role is to use the database content / var / lib / rpm below to compare all of the software files in the current environment linux system, that is when you have the contents of the file data is not accidentally lost or inadvertently changed to a piece of software , use this simple method to test the original file system

#rpm -Va list of all current may be altered file system above

Extract files from the rpm package;

命令格式:  rpm2cpio file.rpm |cpio -div

For example:

[root@localhost RPMS]# rpm2cpio gaim-1.3.0-1.fc4.i386.rpm |cpio -div

Extracted files when used in the operation of the directory usr and etc in; in fact, better to be able to get files specify the installation directory to install the software easy to come; the same can be extracted file; specify the installation directory for the package: To add -relocate parameter; the following example is to specify gaim-1.3.0-1.fc4.i386.rpm installed in / opt / gaim directory;

[root@localhost RPMS]# rpm -ivh  --relocate /=/opt/gaim  gaim-1.3.0-1.fc4.i386.rpm

Preparing...                ########################################### [100%]

   1:gaim                   ########################################### [100%]

[root@localhost RPMS]# ls /opt/

gaim

This can also glance; gaim all files are installed in / opt / gaim, we just put it back up gaim directory and then remove gaim; this fact can be considered that the use of the extracted files;

RPM configuration file;

RPM package management, configuration file is rpmrc, we can find in their own system; rpmrc files such as Fedora Core 4.0 is located;

[root@localhost RPMS]# locate rpmrc

/usr/lib/rpm/rpmrc

/usr/lib/rpm/redhat/rpmrc

We can see through the rpm --showrc; concrete had to learn ourselves. Ah. . . Do not ask me, I do not know; as long as you read this article, think useful to you, on your level and I am almost; we are the same level, so I can not help you up; please understand.

Guess you like

Origin www.cnblogs.com/fanweisheng/p/11108733.html