URPMI

From LQWiki
Jump to navigation Jump to search

urpmi is an rpm wrapper which makes installation of rpm files easier for the user. It is a part of Mandriva's urpm perl tools which make package installation and management hassle-free. Note:In most setups, urpmi command only works for root user.

RPMDrake

The GUI front-end of urpmi is called RPMDrake and can be accessed on Mandriva and Mandrake systems through the Mandriva or Mandrake Control Center.

Sources(Media)

urpmi maintains the list of rpm packages found in sources, referred to by it as 'media'. Sources (or media), include removable discs(CD/DVD ROMs), http sites, ftp sites, computers in a local network and local directories. urpmi sources for various Mandriva or Mandrake releases can be setup by the following steps:

  • For Mandriva or Mandrake Consumer products, visit EasyURPMI. This tool does not support the Mandriva Corporate Products (i.e. Corporate Server, Corporate Desktop, MNF2, etc.).
  • Select the different media which you want to install (main, contrib, jpackage...etc.)
  • Select the sources for your media (from various ftp and http mirrors).
  • Open a shell and as root enter the commands generated at the last step.

addmedia

urpmi.addmedia [options] <name> <url> [with <relative_path>]

This adds a medium with the name <name> and location <url>. For ftp and http locations, a hdlist file stores information about the packages present in the location.

eg.

urpmi.addmedia plf-nonfree ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandrake/non-free/10.2 with hdlist.cz

This command adds a medium 'plf-nonfree' with ftp://ftp.free.fr as the source.

See urpmi man page

 man urpmi

for more information regarding the options.

update

urpmi.update <media>

This command updates the <media> specified. eg.

urpmi.update main contrib

This updates the media main and contrib. i.e. It downloads the latest packages list.

removemedia

urpmi.removemedia <media>

The command removes the packagelist of <media>.

eg.

urpmi.removemedia plf-nonfree

This removes the media plf-nonfree(and its package list), from the list of its sources.

Running URPMI

urpmi [options] <nameofpackage>

urpmi, when no options are given, searches the package lists of various media for <nameofpackage> and finds if the package is installed, and if installed, checks if it is the latest version(as available in the package list of sources). If the version of the <nameofpackage> is the latest(as per package list records), then a message similar to "The package(s) are already installed" is displayed.

If there is a newer version of <nameofpackage> to be installed, urpmi then finds the dependencies for <nameofpackage> and then finds if they are installed and if they are, it finds if they are the latest version. If the dependencies are not installed (or if they are not the latest version), urpmi then presents the dependencies along with <nameofpackage> and their total size to the user and asks if they want to continue, installing <nameofpackage>(and its dependencies).

[options] include

  • --media (which installs from particular media,separated by comma(s)).

eg.

urpmi --media main,update amarok
This searches for the package amarok in the media main and update.
  • --update (which uses only the update medium).
  • --excludemedia (which excludes particular media,separated by comma(s)).
  • --auto-select (which automatically selects packages and upgrades the system).

See urpmi man page

 man urpmi

for more information regarding the options.

urpmf

urpmf is a tool(part of urpm) which is used to find files within packages. This works by scanning a summary of the headers of the rpms in the hdlist file.

urpmq

urpmq is a tool(part of urpm) which queries the urpmi database for packages.

urpme

urpme <packagename>

urpme is a tool(part of urpm) which is used to remove rpm packages installed in the system. eg.

urpme amarok

This command removes the package 'amarok' from the system.

See urpme man page

 man urpme

for more information regarding the options.

Tips

Backup RPMs Urpmi automatically deletes the rpms downloaded from media after successful installation. If you want to save the RPMs for future use you can use the --noclean option eg.

urpmi --noclean amarok

Note:The RPMs are stored in "/var/cache/urpmi/rpms" in most cases.

Installation from local directory Local directories, unlike ftp and http sites, do not require a hdlist file(urpmi generates the file by itself). With the help of this feature, you can store rpms in a local directory and use the directory as a medium. eg.

urpmi.addmedia backup /root/backup

This command adds a medium called 'backup' which points to the location /root/backup.


Avoid Prompts

urpmi --force <packagename>

This option forces urpmi to continue without asking the user for his opinion. i.e it assumes yes on all prompts.

Remove all media To remove all the media and their package lists do

urpmi.removemedia -a

The Easy Way

Visit Easy Urpmi and follow the instructions.

  • Tip1: Choose "Use compressed index, much smaller than normal, with less informations" if you do not wish to download about 100MB.
  • Tip2: The process might stop. In case there is not an error, simply press "Enter" to continue.

See also

External links