Subscribe to News

RPM Package Management

Author : Vicente

From TechnologicalWiki

Jump to: navigation, search
This article doesn't belong to any category. Each article must belong at least some the next categories :
- OpenSource - HowTo - Mobile - Project - ProjectSection - UnifiedCommunications - OSAmI -

Please add a valid category to the end of the article.

Following lines show a list of commands useful to deal with rpm files and packages:

Contents

[edit] RPM commands

Lists if a package is installed

$rpm -q package_name

  e.g: rpm -q subversion


Shows information about an istalled package

$rpm -qi package_name


Shows info about all installed packages

$rpm -qai


Tells us which package contains file_name installed file.

$rpm -qf file_name

e.g: rpm -qf '/bin/cp'


Installs a rpm package

#rpm -i package


Removes a package

#rpm -e package


Lists all files in a package

$rpm -ql package

e.g: rpm -ql subversion


Lists all files from a rpm file

$rpm -qlp rpm_package_file


Lists installation scripts

$rpm -q --scripts package_name

e.g: $rpm -q --scripts subversion


List package dependency requirements

$rpm -qR package_name

e.g: $rpm -qR subversion

[edit] EXTRACTING RPM PACKAGE CONTENTS

$rpm2cpio package_name.rpm | cpio -idmv

[edit] YUM commands

Installs a package from a repository

#yum install package_name

e.g: #yum install subversion


Updates a package

#yum update package_name

e.g: #yum update subversion


Removes a package

#yum remove package_name

e.g: #yum remove subversion


Lists a package by name:

$yum list package_name

e.g: $yum list subversion


Searchs in packages:

The search option checks the names, descriptions, summaries and listed package maintainers of all of the available packages

$yum search search_string

e.g: $yum search subver

The provides option checks both the files included in the packages and the functions that the software provides.

$yum provides search_string

e.g: $yum provides "*/rpmbuild"
e.g: $yum provides "*/twisted/python/release*"


Upgrades all your system

#yum update


Lists all package dependencies

$yum deplist package_name

e.g: $yum deplist subversion


ADDING A NEW REPOSITORY TO YUM

Simply copy the .repo file from the repository you want to add to /etc/yum.repos.d directory.

[edit] ZYPPER commands

Installs a package

#zypper install package_name

e.g: #zypper install subversion


Search for a package

#zypper search foo

e.g: $zypper search subversion

[edit] PACKAGE-CLEANUP commands

List all packages that do not pertain to any current repository

$package-cleanup --orphan

[edit] Reference

http://docs.fedoraproject.org/yum/en/index.html

$man rpm

$man package-cleanup

http://www.rpm.org


Main Collaborators