Tuesday, May 12, 2009

Useful RPM commands in Mandriva

Mandriva provides some very nice commands which wrap rpm and allow you to install/remove packages directly from the repositories and query package information. Heres a short list of some the more useful commands....

urpmi blahblah
Install package blahblah.

urpme blahblah
Remove package blahblah.

urpme --auto-orphans
Remove all orphaned packages (I believe this is a recent addition).

urpmi --auto-update
Update all packages which have update available from one of the update repositories.

urpmi --clean
Clean the package cache on the local harddrive. Useful if a package gets corrupted during download and you cannot install it. Each successive attempt to repeat the install will use the cached version - gotta clean that cache first.

urpmi --test blahblah
Tests the install of a package without actually installing anything.

urpmq --summary blahblah
Display summary information about package blahblah.

urpmf regex
List all packages which contain a file whose name matches the regular expression regex. regex can therefore be the full filename, a partial filename or a more complex regular expression.

urpmf -f regex
Lists all packages as before and also displays the full package version and architecture information.

urpmq regex
Find if a package exists which has a name exactly matching regex. The parameter regex can be a Perl like regular expression.

urpmq -i regex
Display detailed information about a package.

urpmq -a regex
List all packages whose name fully or partially matches the regular expression regex. Useful when you don't know the full name of a package.

urpmq -f regex
Display the package name, version and architecture of matching package.

urpmq -l regex
List all files in matching package.

rpm -q blahblah
Check if package blahblah is installed.

The raw rpm command does allow you to query package information however the package must already be installed.

rpm -qa
List all installed packages.

rpm -ql blahblah
List the files in installed package blahblah

rpm -qi blahblah
Display detailed information about the installed package blahblah.

rpm -qR blahblah
List the packages which package blahblah depends on.

1 comments:

Pombolo said...

This page helped me out a great deal more than other sites seeking to 'explain' things. Thanks.

Post a Comment