Using RPM

Install
RPM packages typically have file names like foo-1.0-1.i386.rpm. The file name includes the package name (foo), version (1.0), release (1), and architecture (i386). To install a package, log in as root and type the following command at a shell prompt:
rpm -Uvh foo-1.0-1.i386.rpm
-U, Upgrade
-h, Print 50 hash marks as the package archive is unpacked. Use with -v|--verbose for a nicer display.

Force Install (Package Already Installed)
if you want to install the package anyway, you can use the --replacepkgs option, which tells RPM to ignore the error:
rpm -ivh --replacepkgs foo-1.0-1.i386.rpm

Unresolved Dependency 
RPM packages may sometimes depend on other packages, which means that they require other packages to be installed to run properly. If you try to install a package which has an unresolved dependency, output similar to the following is displayed
error: Failed dependencies: 
bar.so.2 is needed by foo-1.0-1
Suggested resolutions:
bar-2.0.20-3.i386.rpm


add it to the command:
rpm -ivh foo-1.0-1.i386.rpm bar-2.0.20-3.i386.rpm

Uninstalling
Type the following command at a shell prompt:
rpm -e foo

You can encounter a dependency error when uninstalling a package if another installed package depends on the one you are trying to remove. For example:
error: Failed dependencies:
foo is needed by (installed) bar-2.0.20-3.i386.rpm


To make RPM ignore this error and uninstall the package anyway (which may break the package dependent on it) use the --nodeps option.

Upgrading
Upgrading a package is similar to installing one. Type the following command at a shell prompt:
rpm -Uvh foo-2.0-1.i386.rpm

If you attempt to upgrade to a package with an older version number (that is, if a more updated version of the package is already installed), the output is similar to the following: 
package foo-2.0-1 (which is newer than foo-1.0-1) is already installed

To force RPM to upgrade anyway, use the --oldpackage option:
rpm -Uvh --oldpackage foo-1.0-1.i386.rpm

Querying (опрашивание)
The rpm -q package name command displays the package name, version, and release number of the installed package package name.
rpm -q foo
foo-2.0-1

-a — queries all currently installed packages.
-p <packagefile> — queries the uninstalled package <packagefile>.

Ищем пакеты среди установленных с фильтром "samba"
rpm -qa | grep samba

Verifying
To verify a package containing a particular file:
rpm -Vf /usr/bin/foo
In this example, /usr/bin/foo is the absolute path to the file used to query a package.

To verify ALL installed packages throughout the system:
 rpm -Va

To verify an installed package against an RPM package file:
rpm -Vp foo-1.0-1.i386.rpm
This command can be useful if you suspect that your RPM databases are corrupt

The following characters denote specific discrepancies:
  • 5 — MD5 checksum
  • S — file size
  • L — symbolic link
  • T — file modification time
  • D — device
  • U — user
  • G — group
  • M — mode (includes permissions and file type)
  • ? — unreadable file










Comments

Popular posts from this blog

Петли L2, методы борьбы (PortFast, LoopGuard, BPDU guard, BPDU filter)

Проброска static маршрута в OSPF

EtherChannel