From Mageia wiki
Jump to: navigation, search
(Add bottom chapter with link to Ways_to_install_programs)
 
(69 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
[[Category:Documentation]]
 
[[Category:Mageia tools]]
 
[[Category:Mageia tools]]
[[Category:Documentation]]
+
[[Category:URPMI]]
{{multi language banner|[https://wiki.mageia.org/de/URPMI Deutsch] ; [[URPMI|English]] ; [[URPMI-fr|Français]] ;}}
+
 
{{introduction|{{cmd|urpmi}} is Mageia's command line tool for managing packages and repositories (media). For example you can install, update or remove software packages with it. {{cmd|urpmi}} handles dependencies automatically i. e. it checks and resolves dependencies if necessary. For beginners the graphical tool [[Rpmdrake|rpmdrake]] is recommended over {{cmd|urpmi}} as rpmdrake is more user-friendly for inexperienced users.}}
+
{{Multi language banner|[[URPMI-de|Deutsch]] ; [[URPMI|English]] ; [[Comando URPMI|Español]] ; [[URPMI-fr|Français]] ; [[URPMI-nl|Nederlands]] ;}}
 +
 
 +
{{introduction|{{cmd|urpmi}} is Mageia's command line tool for managing packages and repositories (media). For example you can install, update or remove software packages with it. {{cmd|urpmi}} handles dependencies automatically i. e. it checks and resolves dependencies if necessary. For beginners the graphical tool [[Software management|{{format text|your text='''rpmdrake'''|color=2397D4FF}}]] is recommended over {{cmd|urpmi}} as rpmdrake is more user-friendly for inexperienced users.}}
  
__TOC__
+
== Overview ==
  
= Overview =
 
 
In order to get a general idea of {{cmd|urpmi}} have a look at it's command line interface and some basic use cases:
 
In order to get a general idea of {{cmd|urpmi}} have a look at it's command line interface and some basic use cases:
  
== The command line interface ==
+
=== The command line interface ===
 +
 
 
The command line interface of {{cmd|urpmi}} is subdivided into the following basic commands:
 
The command line interface of {{cmd|urpmi}} is subdivided into the following basic commands:
  
{| class="wikitable" width="100%"
+
{| {{UsualTable}}
 
! Command !! Description
 
! Command !! Description
 
|-
 
|-
Line 31: Line 34:
  
  
== Common use cases ==
+
=== Common use cases ===
 +
 
 
The following lists provide a brief overview of some common use cases of {{cmd|urpmi}}:
 
The following lists provide a brief overview of some common use cases of {{cmd|urpmi}}:
  
=== Basic commands: Install, remove, update ===
+
==== Basic commands: Install, remove, update ====
{| class="wikitable" width="100%"
+
 
 +
{| {{UsualTable}}
 
! Command !! Description
 
! Command !! Description
 
|-
 
|-
Line 45: Line 50:
 
|}
 
|}
  
=== Media/Repository commands ===
+
==== Media/Repository commands ====
{| class="wikitable" width="100%"
+
 
 +
{| {{UsualTable}}
 
! Command !! Description
 
! Command !! Description
 
|-  
 
|-  
Line 54: Line 60:
 
|-
 
|-
 
| urpmq --list-url || '''Show''' all repositories and their URLs.
 
| urpmq --list-url || '''Show''' all repositories and their URLs.
 +
|-
 +
| urpmq --list-media active || '''Show''' all active repositories
 +
|-
 +
| urpmq --list-media active --list-url || '''Show''' all active repositories and their URLs
 
|-
 
|-
 
| urpmi.addmedia NAME URL || '''Add''' a new media with NAME and URL.
 
| urpmi.addmedia NAME URL || '''Add''' a new media with NAME and URL.
Line 60: Line 70:
 
|}
 
|}
  
=== Search commands ===
+
==== Search commands ====
{| class="wikitable" width="100%"
+
 
 +
{| {{UsualTable}}
 
! Command !! Description
 
! Command !! Description
 
|-  
 
|-  
Line 75: Line 86:
 
|}
 
|}
  
= {{prog|urpmi.addmedia}} =
+
== urpmi.addmedia ==
  
 
This is where the whole thing starts. You add a <b>software repository</b> (a.k.a. medium, mirror) using the {{prog|urpmi.addmedia}} command. The format for adding a new repository is as follows:
 
This is where the whole thing starts. You add a <b>software repository</b> (a.k.a. medium, mirror) using the {{prog|urpmi.addmedia}} command. The format for adding a new repository is as follows:
  
<pre>
+
{{pre|urpmi.addmedia nameofmedia ftp://ftp.site.com/path/to/Mageia/RPMS}}
urpmi.addmedia nameofmedia ftp://ftp.site.com/path/to/Mageia/RPMS
 
</pre>
 
  
but effectively you are working behind the scenes juggling the same as if you are using {{cmd|drakrpm-edit-media}} which is the [https://doc.mageia.org/mcc/6/en/content/drakrpm-edit-media.html GUI] in Mageia Control Center under {{menu|Software Management --> Select from where software packages are downloaded when updating the system}}
+
but effectively you are working behind the scenes juggling the same as if you are using {{cmd|drakrpm-edit-media}} which is the [https://doc.mageia.org/mcc/9/en/content/software-management.html#drakrpm-edit-media GUI] in Mageia Control Center under {{menu|Software Management --> Select from where software packages are downloaded when updating the system}}
  
 
Mageia mirrors for final release versions contain at least the following repositories (media):
 
Mageia mirrors for final release versions contain at least the following repositories (media):
* <b>core</b> which contains free and open source software
+
* {{core}} which contains free and open source software
* <b>non-free</b> which contains some proprietary software
+
* {{nonfree}} which contains some proprietary software
* <b>tainted</b> which contains software which may be subject to patent claims in some countries
+
* {{tainted}} which contains software which may be subject to patent claims in some countries
Here is some other explanations about [http://doc.mageia.org/installer/6/en/content/media_selection.html these categories].
+
Here is some other explanations about [http://doc.mageia.org/installer/9/en/content/software.html#media_selection these categories].
  
Each media has 4 sub-medias:
+
Each media has five sub-medias:
* <b>release</b> the packages as of the release day.
+
* {{media|release}} the packages as of the release day.
* <b>updates</b> the packages updated since the release day for security or bug concerns. Everyone should have this medium, even with a very slow internet connection. When adding an update medium, add the {{prog|--update}} switch so {{prog|urpmi}} can distinguish it from a regular medium.
+
* {{media|updates}} the packages updated since the release day for security or bug concerns, or important updates (i.e web browsers). Everyone should have this medium, even with a very slow internet connection. When adding an update medium, add the {{prog|--update}} switch so {{prog|urpmi}} can distinguish it from a regular medium.
* <b>update_testing</b> which is used to temporary tests of new updates, to allow the bug reporters to validate the corrections.
+
* {{media|update testing}} which is used for temporary tests of new updates, to allow the bug reporters to validate the corrections.
* <b>backports</b> some packages of new versions backported from Cauldron, or updates that may need manual assistance so they can not be in updates (i.e ownCloud on Mageia 5)
+
* {{media|backports}} some packages of new versions backported from Cauldron, or updates that may need manual assistance so they can not be in updates (i.e Nextcloud server)
* <b>backports_testing</b> which is used to temporary tests of new backports, to allow the bug reporters to validate the corrections.
+
* {{media|backports testing}} which is used for temporary tests of new backports, to allow the bug reporters to validate the corrections.
 
 
To be able to install packages from a mirror, urpmi needs one of two files containing in compressed format either: the <i>most essential</i> or the <i>most complete</i> set of data.
 
  
 
Please see [[Mirrors policy]] for a complete overview of the mirror structure which <b><i>can</i></b> be found on most mirrors.
 
Please see [[Mirrors policy]] for a complete overview of the mirror structure which <b><i>can</i></b> be found on most mirrors.
Line 106: Line 113:
  
 
If you don't like using the CD or a DVD when updating your system and you have room to spare in your harddrive, make a directory (for example: {{file|/home/uid/repo/}}), copy the {{file|x86_64/media}} or {{file|i586/media}} directories recursively from the CD or DVD there. After removing the install CD or DVD open a terminal/console and type as root:
 
If you don't like using the CD or a DVD when updating your system and you have room to spare in your harddrive, make a directory (for example: {{file|/home/uid/repo/}}), copy the {{file|x86_64/media}} or {{file|i586/media}} directories recursively from the CD or DVD there. After removing the install CD or DVD open a terminal/console and type as root:
 
+
{{pre|<nowiki>cd /home/uid/repo
 
+
genhdlist2</nowiki>}}
  cd /home/uid/repo
 
  genhdlist2
 
 
 
  
 
Now you can add the media, either via urpmi.addmedia:
 
Now you can add the media, either via urpmi.addmedia:
 
+
{{pre|urpmi.addmedia --distrib HD file://home/uid/repo}}
 
 
  urpmi.addmedia --distrib HD file://home/uid/repo
 
 
 
  
 
Or use the media manager via {{menu|Mageia Control Center --> Software Management --> Select from where software packages are downloaded when updating the system}} to set up your new directory and disable all the CD or DVD entries.
 
Or use the media manager via {{menu|Mageia Control Center --> Software Management --> Select from where software packages are downloaded when updating the system}} to set up your new directory and disable all the CD or DVD entries.
Line 124: Line 125:
 
Make a directory, for example {{file|~/RPMS}}, to hold all the RPM's. Then in order to copy a bunch of RPM's (from the install CD or DVD, for example) you type:
 
Make a directory, for example {{file|~/RPMS}}, to hold all the RPM's. Then in order to copy a bunch of RPM's (from the install CD or DVD, for example) you type:
  
<pre>
+
{{pre|find /INSTALL_CD/ -name *.rpm -print -exec cp {} ~/RPMS \;}}
  find /INSTALL_CD/ -name *.rpm -print -exec cp {} ~/RPMS \;
 
</pre>
 
  
 
If you have copied the install CD or DVD to the hard drive, or have their ISO images on the drive (see [[#Copying_CD_or_a_DVD_to_a_home_directory_and_using_the_copy_in_urpmi|Copy CD or DVD to Hard Drive]] on how to mount them), this can be done in one step.
 
If you have copied the install CD or DVD to the hard drive, or have their ISO images on the drive (see [[#Copying_CD_or_a_DVD_to_a_home_directory_and_using_the_copy_in_urpmi|Copy CD or DVD to Hard Drive]] on how to mount them), this can be done in one step.
Line 132: Line 131:
 
In this example, the CD or DVD were mounted as {{file|/INSTALL_CD/}}.
 
In this example, the CD or DVD were mounted as {{file|/INSTALL_CD/}}.
  
<pre>
+
{{pre|<nowiki>cd ~/RPMS
  cd ~/RPMS
+
genhdlist2</nowiki>}}
  genhdlist2
 
</pre>
 
  
 
It will then create a {{file|hdlist.cz}} file and a {{file|sythesis.hdlist.cz}} file based on what it finds in the directory it is in.
 
It will then create a {{file|hdlist.cz}} file and a {{file|sythesis.hdlist.cz}} file based on what it finds in the directory it is in.
Line 141: Line 138:
 
Find the pubkeys for the RPM's and copy them into {{file|~/RPMS/pubkey}}. They should be in {{file|INSTALL_CD/media/media_info}} :
 
Find the pubkeys for the RPM's and copy them into {{file|~/RPMS/pubkey}}. They should be in {{file|INSTALL_CD/media/media_info}} :
  
<pre>
+
{{pre|<nowiki>mkdir ~/RPMS/pubkey
  mkdir ~/RPMS/pubkey
+
cp /INSTALL_CD/media/media_info/pubkey* ~/RPMS/pubkey/</nowiki>}}
  cp /INSTALL_CD/media/media_info/pubkey* ~/RPMS/pubkey/
 
</pre>
 
  
 
then as root add the medium:
 
then as root add the medium:
  
<pre>
+
{{preurpmi.addmedia local_rpms  file://home/uid/RPMS/}}
  urpmi.addmedia local_rpms  file://home/uid/RPMS/
 
</pre>
 
  
 
=== Adding media for a distribution ===
 
=== Adding media for a distribution ===
  
{{prog|urpmi}} can add important media (e.g. main, updates, contrib ...) from a chosen mirror with a single command. As root type in a terminal/console:
+
{{prog|urpmi}} can add important media (e.g. core, nonfree, tainted ...) from a chosen mirror with a single command. As root type in a terminal/console:
  
<pre>
+
{{pre|urpmi.addmedia --distrib ftp://'MIRROR_SITE'/mirror/mageia/distrib/'VERSION'/'ARCH'}}
urpmi.addmedia --distrib ftp://'MIRROR_SITE'/mirror/mageia/distrib/'VERSION'/'ARCH'
 
</pre>
 
  
 
in which:
 
in which:
Line 166: Line 157:
  
 
=== Manually choosing a mirror ===
 
=== Manually choosing a mirror ===
Mirrors are listed at http://mirrors.mageia.org/ -choose one close to you (in internet route measures)
 
  
The status page http://mirrors.mageia.org/status help in avoiding bad mirrors.
+
Mirrors are listed at https://mirrors.mageia.org/ -choose one close to you (in internet route measures)
 +
 
 +
The status page https://mirrors.mageia.org/status help in avoiding bad mirrors.
  
 
=== Selecting mirror automatically using aria2 ===
 
=== Selecting mirror automatically using aria2 ===
 +
 
It is possible to automatically select mirrors using the --mirrorlist option. This command will add important medias selecting the mirrors automatically :
 
It is possible to automatically select mirrors using the --mirrorlist option. This command will add important medias selecting the mirrors automatically :
<pre>
+
{{pre|urpmi.addmedia --distrib --mirrorlist '$MIRRORLIST'}}
urpmi.addmedia --distrib --mirrorlist '$MIRRORLIST'
 
</pre>
 
  
 
=== Finding mirrors near you using rsync and urpmi to update ===
 
=== Finding mirrors near you using rsync and urpmi to update ===
Line 180: Line 171:
 
Please see: https://wiki.mageia.org/en/Finding_Mageia_rsync_servers
 
Please see: https://wiki.mageia.org/en/Finding_Mageia_rsync_servers
  
= {{prog|urpmi.update}} =
+
== urpmi.update ==
  
 
The {{prog|urpmi.update}} command updates the list of packages from a package repository. This list changes whenever the packages in the server change, so you need to update it whenever you want to install a new package from a changeable repository, like Mageia Cauldron <i>(Be very careful with Cauldron packages; they might work but installing them <b>usually does cause problems further down the road on a stable version!</b>)</i>. If you are using a repository for a final release, it normally does not change, so you do not need to update the list whenever you install.  
 
The {{prog|urpmi.update}} command updates the list of packages from a package repository. This list changes whenever the packages in the server change, so you need to update it whenever you want to install a new package from a changeable repository, like Mageia Cauldron <i>(Be very careful with Cauldron packages; they might work but installing them <b>usually does cause problems further down the road on a stable version!</b>)</i>. If you are using a repository for a final release, it normally does not change, so you do not need to update the list whenever you install.  
  
You can use {{prog|urpmi.update}} like this:
+
To update all enabled media, use
  
<pre>
+
{{pre|<nowiki>urpmi.update -a</nowiki>}}
urpmi.update nameofmedia
 
</pre>
 
  
or
+
To update specific media(s):
  
<pre>
+
{{pre|<nowiki>urpmi.update nameofmedia1 nameofmedia2 ...</nowiki>}}
urpmi.update -a
 
</pre>
 
  
The first example will update just the specified medium whereas the last command will update all media.
+
i.e one specific media: {{cmd|urpmi.update 'Nonfree 32bit Updates'}}, or two: {{cmd|urpmi.update 'Nonfree 32bit Updates' 'Nonfree Updates'}}. Note the citation marks.
  
= {{prog|urpmi.removemedia}} =
+
Actually it match the given names to any media, so {{cmd|urpmi.update Upd}} will update all medias containing "Upd", i.e all updates media - even them that are not enabled!
 +
 
 +
Sometimes you would like to [[#Install from non enabled media, i.e Backports|Install from non enabled media, i.e Backports]], and to update all configured media including non enabled, a trick is to use
 +
 
 +
{{pre|<nowiki>urpmi.update e</nowiki>}}
 +
 
 +
It works because the words core, nonfree, and tainted, all have the letter e in them ;)
 +
 
 +
== urpmi.removemedia ==
  
 
If you want to get rid of a repository, this is the command to use:
 
If you want to get rid of a repository, this is the command to use:
  
<pre>
+
{{pre|urpmi.removemedia nameofmedia}}
urpmi.removemedia nameofmedia
 
</pre>
 
  
 
To remove all repositories:
 
To remove all repositories:
  
<pre>
+
{{pre|urpmi.removemedia -a}}
urpmi.removemedia -a
 
</pre>
 
  
= {{prog|urpmf}} =
+
== urpmf ==
  
 
With {{prog|urpmf}} you can find any file that you may want, know what package it belongs to, see a description of the package and a bunch of other things.
 
With {{prog|urpmf}} you can find any file that you may want, know what package it belongs to, see a description of the package and a bunch of other things.
 +
 +
Note that it only search within enabled medias, see [[#urpmq]].
  
 
Suppose that you want to compile a C program on your box and the compiler complains about {{file|jpeglib.h}} missing. All that you have to do is:
 
Suppose that you want to compile a C program on your box and the compiler complains about {{file|jpeglib.h}} missing. All that you have to do is:
Line 222: Line 215:
 
That will output, for example:
 
That will output, for example:
  
<pre>
+
{{pre|<nowiki>libjpeg62-devel:/usr/include/jpeglib.h
libjpeg62-devel:/usr/include/jpeglib.h
+
mozilla-devel:/usr/include/mozilla-1.4a/jpeg/jpeglib.h</nowiki>}}
mozilla-devel:/usr/include/mozilla-1.4a/jpeg/jpeglib.h
 
</pre>
 
  
This means that the jpeglib header file is part of the package {{pkg|libjpeg62-devel}}, and can now be installed with:
+
This means that the jpeglib header file is part of the package {{prog|libjpeg62-devel}}, and can now be installed with:
  
 
{{cmd|urpmi libjpeg62-devel}}
 
{{cmd|urpmi libjpeg62-devel}}
Line 235: Line 226:
 
{{cmd|urpmf --summary mail -a client}} returns:
 
{{cmd|urpmf --summary mail -a client}} returns:
  
<pre>
+
{{pre|<nowiki>evolution:Integrated GNOME mail client, calendar and address book.
evolution:Integrated GNOME mail client, calendar and address book.
 
 
squirrelmail:Squirrelmail is a webmail client for PHP4.
 
squirrelmail:Squirrelmail is a webmail client for PHP4.
 
sylpheed-claws:Enhanced version of the Sylpheed e-mail client
 
sylpheed-claws:Enhanced version of the Sylpheed e-mail client
Line 242: Line 232:
 
cscmail:CSCMail is a GTK email client written in Perl
 
cscmail:CSCMail is a GTK email client written in Perl
 
sylpheed:A GTK+ based, lightweight, and fast e-mail client
 
sylpheed:A GTK+ based, lightweight, and fast e-mail client
tradeclient:Email Client with PIM features for X
+
tradeclient:Email Client with PIM features for X</nowiki>}}
</pre>
 
  
 
The {{cmd|--summary}} option is used to perform a search on the summary, and the <b>{{cmd|-a}}</b> switch translates 'and'.
 
The {{cmd|--summary}} option is used to perform a search on the summary, and the <b>{{cmd|-a}}</b> switch translates 'and'.
  
= {{prog|urpmi}} =
+
== urpmi ==
  
 
This is the main package management command, which you use to install the package you want as well as the packages that it depends on:  
 
This is the main package management command, which you use to install the package you want as well as the packages that it depends on:  
  
<pre>
+
{{pre|urpmi nameofpackage}}
urpmi nameofpackage
 
</pre>
 
  
 
For instance, if you think that Sylpheed is a good e-mail client because it describes itself as 'lightweight', you install it with: {{cmd|urpmi sylpheed}}.
 
For instance, if you think that Sylpheed is a good e-mail client because it describes itself as 'lightweight', you install it with: {{cmd|urpmi sylpheed}}.
Line 265: Line 252:
 
See several remarks about {{cmd|urpmq --fuzzy}} below to learn how to avoid such versioning problems.
 
See several remarks about {{cmd|urpmq --fuzzy}} below to learn how to avoid such versioning problems.
  
== System update ==
+
=== System update ===
 +
 
 
Another example of using {{prog|urpmi}} is to '''update your system with the latest security updates/bugfixes''':
 
Another example of using {{prog|urpmi}} is to '''update your system with the latest security updates/bugfixes''':
  
<pre>
+
{{command|urpmi --auto-update|prompt=#}}
urpmi --auto-update
+
 
</pre>
 
 
The command above brings the system up-to-date do the same as the following command sequence:
 
The command above brings the system up-to-date do the same as the following command sequence:
  
<pre>
+
{{command|urpmi.update -a && urpmi --auto-select|prompt=#}}
urpmi.update -a && urpmi --auto-select
 
</pre>
 
  
 
The <b>{{cmd|&&}}</b> characters mean "IF the first command succeeds, then perform the second command". The first command ({{Cmd|urpmi.update -a}}) updates for all media the list of available software packages. The second command ({{Cmd|urpmi --auto-select}}) selects all available updates of already installed packages and initiates the update process. {{prog|Urpmi}} will list the upgradeable packages and ask if you wish to proceed. If you want to proceed, just type y for yes or n for no and then press Enter. When the update-process is finished installing you'll get a new prompt at the bottom.
 
The <b>{{cmd|&&}}</b> characters mean "IF the first command succeeds, then perform the second command". The first command ({{Cmd|urpmi.update -a}}) updates for all media the list of available software packages. The second command ({{Cmd|urpmi --auto-select}}) selects all available updates of already installed packages and initiates the update process. {{prog|Urpmi}} will list the upgradeable packages and ask if you wish to proceed. If you want to proceed, just type y for yes or n for no and then press Enter. When the update-process is finished installing you'll get a new prompt at the bottom.
  
If you prefer using a graphical userinterface ('GUI') use {{prog|rpmdrake}} in the Mageia Control Center: {{menu| Software Management --> Look at available updates and apply any fixes or upgrades to installed packages}}
+
If you prefer using a graphical user interface ('GUI') use {{prog|rpmdrake}} in the Mageia Control Center: {{menu| Software Management --> Look at available updates and apply any fixes or upgrades to installed packages}}
  
== Installing a new / other kernel ==
+
=== System upgrade to the latest Mageia version ===
If you have a separate /boot, make sure you have enough space:
 
$ df
 
  
Display running kernel:
+
{{prog|Urpmi}} can also be used to upgrade your system to a newer release of Mageia.
$ uname -r
 
  
Display installed kernels (packages whose name begin with "kernel")
+
'''In short:'''
$ rpm -qa | grep ^kernel | sort
 
  
To list available kernels and versions: (and other packages that have "kernel" in them)
+
Remove old mirror set:
# urpmq -y kernel 
+
{{command|urpmi.removemedia -a|prompt=#}}
''"-y" is short for "--fuzzy"''
+
Add new release mirror set (here as example Mageia 9):
 +
{{command|urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.9.$ARCH.list'|prompt=#}}
 +
Start upgrading:
 +
{{command|urpmi --auto-update --auto --force|prompt=#}}
  
Information on the different types: https://wiki.mageia.org/en/Kernel_flavours
+
'''Important:''' Before starting, do read [[Mageia_9_Release_Notes#Online-Upgrade, using urpmi (CLI)|the more comprehensive instruction]] in Release Notes!
  
Normally you should make sure you have corresponding "-devel-" package for your kernels.  I.e if you have kernel-desktop-4.9.30-2.mga6, make sure you also have kernel-desktop-devel-4.9.30-2.mga6.  It is needed for i.e linking the Nvidia driver.
+
''(And as usual also browse through rest of Release Notes and Errata.)''
  
Correspondingly there also exist "-source-" packages, but you normally do not need them: This is the source code of the most recent kernel available in the update source. You only need to install the kernel source package if you need to compile anything like a device driver <i>(but it can also be handy to search the documentation included in the package)</i>. Be sure that you have installed the '''same version''' of {{pkg|kernel-source}} as the kernel you are running, or else the drivers you compile will not work.
+
Also see [[How_to_choose_the_right_Mageia_upgrade_method|How to choose the right Mageia upgrade method]].
  
Other dependencies:
+
=== urpmi --parallel pushes updates to machines in your network ===
If you have virtualbox installed, you should have "virtualbox-kernel-..." installed.  And if you have "-latest" on your kernel you should also have the corresponding "virtualbox-kernel-...-latest package.
 
 
 
Automatic updates:
 
If you have kernel packages that ends with "-latest", the latest kernel of that flavour will get automatically installed when you run normal uppdates.
 
Make sure you have "latest" packages installed also for -devel- and -source- if you have it for your kernel, and vice versa.  the "-latest" packages are installed by default - uninstall them if you do not want kernel be updated with normal updates.
 
 
 
To install a kernel:
 
Just urpmi that kernel - the new files needed to boot will install in {{file|/boot}} alongside those of older kernel(s). The {{prog|grub}} or {{prog|lilo}} configuration will be automatically adjusted by adding a new stanza to allow you to boot the old and the new kernels. The default 'linux' stanza will boot the new kernel.
 
 
 
If you wish, you can instead use the rpmdrake GUI {{prog|rpmdrake}} to install a new kernel: {{menu|Mageia Control Center --> Software Management --> Look at installable software and install software packages}}.
 
 
 
== {{prog|urpmi --parallel}} pushes updates to machines in your network ==
 
  
 
Updates are downloaded to one of the machines and from there pushed to the others on your network <!-- (see: http://archives.mandrivalinux.com/expert/2006-03/msg00001.php ) -->
 
Updates are downloaded to one of the machines and from there pushed to the others on your network <!-- (see: http://archives.mandrivalinux.com/expert/2006-03/msg00001.php ) -->
Line 326: Line 298:
  
 
So how to use urpmi --parallel? It's pretty simple, really.
 
So how to use urpmi --parallel? It's pretty simple, really.
First, make sure you can {{prog|ssh}} from the server to each client machine as root (you have to enter a passphrase or password, but can be you set up to use keys and make use of {{cmd|ssh-add}} to avoid that). Now install {{pkg|urpmi-parallel-ssh}} on the server machine. Edit {{file|/etc/urpmi/parallel.cfg}} to look like this:
+
First, make sure you can {{prog|ssh}} from the server to each client machine as root (you have to enter a passphrase or password, but can be you set up to use keys and make use of {{cmd|ssh-add}} to avoid that). Now install {{prog|urpmi-parallel-ssh}} on the server machine. Edit {{file|/etc/urpmi/parallel.cfg}} to look like this:
  
<pre>
+
{{pre|local:ssh:toy:htpc}}
local:ssh:toy:htpc
 
</pre>
 
  
 
the first parameter is the name of the group, make this whatever you like. Leave the second as ssh. The remaining parameters are the hostnames of the machines in the group; as many as you like (but not the server machine: {{cmd|urpmi}} will just fall over its own lock files).
 
the first parameter is the name of the group, make this whatever you like. Leave the second as ssh. The remaining parameters are the hostnames of the machines in the group; as many as you like (but not the server machine: {{cmd|urpmi}} will just fall over its own lock files).
  
Next you can use it. On the server machine, run:
+
Next, you can use it. On the server machine, run:
 +
 
 +
{{pre|urpmi --parallel local somepackage}}
 +
 
 +
As long as {{prog|urpmi}} on the server has an access to all packages required by all client machines from its urpmi media, everything should now work smoothly. The easiest way to ensure this is to have all machines - server and client - use the same urpmi media.
 +
 
 +
=== Install from non enabled media, i.e Backports ===
 +
 
 +
In order to not install backported packaged by mistake, you should not have backport media enabled.
 +
 
 +
You can tell urpmi to install from a non enabled media anyway, just when you want to.
 +
 
 +
(Of course, the media need to be configured and updated, see [[#urpmi.update|urpmi.update]])
 +
 
 +
Here is an example to install gnucash from Backports testing
  
<pre>
+
{{pre|<nowiki>urpmi --search-media 'Backports Testing' gnucash</nowiki>}}
urpmi --parallel local somepackage
 
</pre>
 
  
As long as {{prog|urpmi}} on the server has access to all packages required by all client machines from its urpmi media, everything should now work smoothly. The easiest way to ensure this is to have all machines - server and client - use the same urpmi media.
+
== urpme ==
  
 +
This is the command that uninstalls software from your box. As with {{prog|urpmi}}, it works out the dependencies and tells you if any software that's still installed depends on what you want to uninstall, giving you the chance to abort the procedure or to uninstall the package and those that depend on it. Usage is:
  
=== References ===
+
{{pre|urpme nameofpackage}}
  
* [http://archive.openmandriva.org/wiki/en/index.php?title=LDAP_support_in_urpmi LDAP support in urpmi]
+
For instance, if Sylpheed is so good that you want to get rid of Evolution, your former e-mail client, you can make some place on your hard drive with {{cmd|urpme evolution}}.
* [http://archive.openmandriva.org/wiki/en/index.php?title=Urpmi_Development URPMI-development]
 
  
= {{prog|urpme}} =
+
=== Advanced usage ===
  
This is the command that uninstalls software from your box. As with {{prog|urpmi}}, it works out the dependancies and tells you if any software that's still installed depends on what you want to uninstall, giving you the chance to abort the procedure or to uninstall the package and those that depend on it. Usage is:
+
For removing all apparently unused packages, or for removing a whole task like a desktop environment, see [[Removing packages]].
  
<pre>
+
''Do beware the warnings about possibly removing too much!''
urpme nameofpackage
+
 
</pre>
+
== urpmq ==
 +
 
 +
By using {{prog|urpmq}} you can find out a lot of information about an rpm.
 +
 
 +
* {{cmd|urpmq -i}} can give you information about the rpm's you can install. Try {{cmd|urpmq -i bash}}
 +
* {{cmd|urpmq -d}} gets a list of all rpm's that are needed to install one piece of software.
 +
* {{cmd|urpmq -d bash}} see which rpm's are required.
 +
* add the <b>{{cmd|-m}}</b> switch to see the ones not installed on the system at the moment.
 +
* {{cmd|--sources}} will get the sources.
  
For instance, Sylpheed is so good that you want to get rid of Evolution, your former e-mail client. You can make some place on your hard drive with {{cmd|urpme evolution}}.
+
* So, with {{cmd|urpmq -d -m --sources}} , you can easily get a list of url's that correspond to the rpm you need to get: quite handy if you lack a good connection to the internet.
  
= {{prog|urpmq}} =
+
* {{cmd|urpmq --list-media}} list all configured media, including inactive media.
  
{{prog|urpmq}} allows you to query the {{prog|rpm}} database, so you can find out information about the packages that you have installed or that you can install as well as other things in the database, like what media media you have, like this:
+
To list only the active medias, add "active" on the command line, and you can add option "--list-url" to see where they are fetched from:
  
<pre>
+
{{output|urpmq --list-media active --list-url}}{{withbr|<nowiki>Core Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/core/release
[root@localhost root]# urpmq --list-media  
+
Core Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/core/updates
Core Release (distrib1)
+
Nonfree Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/nonfree/release<
Core Release Debug (distrib2)
+
Nonfree Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/nonfree/updates
Core Updates (distrib3)
+
Core 32bit Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/core/release
Core Updates Debug (distrib4)
+
Core 32bit Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/core/updates
Nonfree Release (distrib11)
+
Nonfree 32bit Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/nonfree/release
Nonfree Release Debug (distrib12)
+
Nonfree 32bit Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/nonfree/updates</nowiki>}}{{stop}}
Nonfree Updates (distrib13)
+
''This example is a 64 bit system with 32 bit medias enabled, and no tainted.''
Nonfree Updates Debug (distrib14)
 
Tainted Release (distrib21)
 
Tainted Release Debug (distrib22)
 
Tainted Updates (distrib23)
 
Tainted Updates Debug (distrib24)
 
Core 32bit Release (distrib31)
 
Core 32bit Release Debug (distrib32)
 
Core 32bit Updates (distrib33)
 
Core 32bit Updates Debug (distrib34)
 
</pre>
 
  
Caveat: when using {{prog|urpmq}} to look for packages, make sure you understand the difference between using it with or without the option <i>--fuzzy</i>. You might miss some packages you were looking for if you are not careful. If {{prog|urpmq}} finds a package with the exact name than the one you queried, it will return this package only and by default, you will not see other packages which include the same name.
+
To edit media, launch media configuration {{cmd|drakrpm-edit-media}}, (alternatively use Mageia Control Center).  If you wish to also select or deselect a media for updates (i.e you are running cauldron), issue {{cmd|drakrpm-edit-media --expert}}.
  
For example:
+
{{Note|* urpmq only search active repositories - You have to configure and make active full distribution medias for urpmq to be able to find all of our packages.
 +
* Use 32 bit repos on 64 bit systems only if needed (i.e for Steam), and if any package from a 32 bit repo have been installed, keep that repo and its update repo enabled in order to not potentially hinder future updates.
 +
* Tainted repos contain programs that may be encumbered by patents, check legality in your country.
 +
* Backport basically only contain packages backported from next Mageia.}}
  
<pre>
+
{{warning|When using {{prog|urpmq}} to look for packages, make sure you understand the difference between using it with or without the option <i>--fuzzy</i>. You might miss some packages you were looking for if you are not careful. If {{prog|urpmq}} finds a package with the exact name than the one you queried, it will return this package only and by default, you will not see other packages which include the same name.}}
        // Imagine your best pal told you about vegastrike, a cool 3D game.
 
[root@localhost yourusername]# urpmq vegastrike           
 
vegastrike                                               
 
        // Great! There is a Mageia package with this exact name!
 
        // But you don't see other packages which include this name!
 
  
        // We query again: notice the missing 'e' at the end of the package name.
+
For example: Imagine your best pal told you about 0ad, a real-time strategy (RTS) game of ancient warfare.
[root@localhost yourusername]# urpmq vegastrik
+
{{output|urpmq -r 0ad}}{{withbr|<nowiki>0ad-0.0.23b-16.mga8
No package named vegastrik
+
0ad-0.0.25-1.mga8
The following packages contain vegastrik: vegastrike, vegastrike-data
+
0ad-0.0.25b-1.mga8
You should use "-a" to use all of them
+
0ad-0.0.25b-1.1.mga8</nowiki>}}{{stop}}
          // This time the query result is very different:
 
          // We see not one but two packages.
 
  
        // Compare the following query to the previous two.
+
''Great! There is a Mageia package with this exact name! But you don't see other packages which include this name! So we query again: notice the missing 'd' at the end of the package name:''
[root@localhost yourusername]# urpmq --fuzzy vegastrike 
+
{{output|urpmq -r 0a}}{{withbr|<nowiki>No package named 0a</nowiki>}}{{stop}}
vegastrike
 
vegastrike-data
 
          // See the difference that the --fuzzy option makes.
 
</pre>
 
  
{{cmd|urpmq --fuzzy}} is also great to see what other available version there may be to a package: sometimes a new major version does not provide full backward compatibiliy. For this reason the newer version will be distributed under a slightly different package name. Now, you are sure not to miss anything.
+
''This time the query result is very different:  We see not one but two packages. Compare the following query to the previous two.''
 +
{{output|urpmq -r --fuzzy 0ad}}{{withbr|<nowiki>0ad-0.0.25b-1.1.mga8
 +
0ad-data-0.0.25b-1.mga8
 +
</nowiki>}}{{stop}}
  
For example:
+
{{cmd|urpmq -r --fuzzy}} is also great to see what other available version there may be to a package: sometimes a new major version does not provide full backward compatibility. For this reason, the newer version will be distributed under a slightly different package name. Now, you are sure not to miss anything.
  
<pre>
+
{{output|urpmq -r --fuzzy fvwm}}{{withbr|<nowiki>fvwm-crystal-3.7.0-1.mga8
[root@localhost augustin]# urpmi mplayer
+
fvwm2-2.6.9-4.mga8
      // This will NOT install the latest version of mplayer.
+
fvwm2-config-mageia-2.6.9-4.mga8
[root@localhost yourusername]# urpmq --fuzzy mplayer
+
fvwm2-doc-2.6.9-4.mga8
The following packages contain mplayer:
+
fvwm3-1.0.2-1.1.mga8
kmplayer
+
fvwm3-config-mageia-1.0.2-1.1.mga8
mplayer
+
fvwm3-doc-1.0.2-1.1.mga8
mplayer-fonts
+
task-fvwm2-1-7.mga8
mplayer-gui
+
</nowiki>}}{{stop}}
mplayer-skins
+
''You see: the new release is packaged in another name (name including increasing version number)''
mplayer1.0
 
mplayer1.0-gui
 
mplayerplugin
 
transcode
 
xmms-mplayer
 
      // You see: the new 1.0 release is packaged separately.
 
      // You have been warned!!
 
</pre>
 
  
= Using Graphical interfaces =
+
== Using Graphical interfaces ==
  
== {{prog|gurpmi}} ==
+
=== gurpmi  ===
  
 
{{prog|gurpmi}} is the graphical front-end for {{prog|urpmi}} and can be used on the commandline to install/search a package from a medium or at the prompt. It is also used by {{prog|rpmdrake}} to display messages that need user interaction.
 
{{prog|gurpmi}} is the graphical front-end for {{prog|urpmi}} and can be used on the commandline to install/search a package from a medium or at the prompt. It is also used by {{prog|rpmdrake}} to display messages that need user interaction.
  
== {{prog|rpmdrake}} ==
+
=== rpmdrake ===
  
Mageia offers a set of nice graphical tools to perform the same tasks. Rpmdrake is the one called from Mageia Control Center to Add/Remove programs.  There you also start update, and select repositories. See [http://doc.mageia.org/mcc/6/en/content/software-management.html our official documentation].
+
Mageia offers a set of nice graphical tools to perform the same tasks. Rpmdrake is the one called from Mageia Control Center to Add/Remove programs.  There you also start an update and select repositories. See [http://doc.mageia.org/mcc/9/en/content/software-management.html our official documentation].
  
== {{prog|manatools}} ==
+
=== manatools ===
  
A not yet complete rewrite of Mageia Control Center, [https://wiki.mageia.org/en/Mageia_5_Release_Notes#ManaTools_preview added in Mageia 5]  Try "mpan" or "mana" to launch.
+
A not yet complete rewrite of Mageia Control Center, [[Mageia_5_Release_Notes#ManaTools_preview | added in '''Mageia 5''']]  Try {{prog|mpan}} or {{prog|mana}} to launch.
  
== {{prog|dnfdragora}} ==
+
=== dnfdragora ===
  
DNF is the rising star in package management. Dnfdragora is the graphical interface [https://wiki.mageia.org/en/Feature:Add_DNF_as_Alternate_Repository_Manager#Current_status in progress] in Mageia 6.  
+
{{cmd|DNF}} is the rising star in package management. {{prog|Dnfdragora}} is the graphical interface.  
  
First you need to set up dnf as per https://wiki.mageia.org/en/Using_DNF
+
See [[Using DNF]] how to set up and use it, and note the current caveats.
Note that there are still a few quirks, see bugzilla, notably you need to update repos using command "dnf makecache" from command line [https://bugs.mageia.org/show_bug.cgi?id=20922 Bug 20922]
 
  
= A question of security =
+
== A question of security ==
  
== What are the security issues ==
+
=== What are the security issues ===
  
 
{{prog|Urpmi}} must be run as root in order to install the packages. A clever but malicious person could possibly trick a not so clever Mageia user (I know that all the Mageia users are clever, but let's assume that there is one gullible Mageia user somewhere, just for the sake of the argument) to install a package that looks like a regular package used by many but that contains a Trojan Horse, some evil code. Once installed, the application may unleash some virus, worm or even some spyware... So far, there hasn't been any news of any such exploit having been attempted, but in a few years time, when GNU/Linux will be the most widely used OS, it is possible that some people would want to try to perform such a feat. Fortunately, they will fail, because a sane concern for security has always been part of the GNU/Linux community. Most packages are signed by the packagers to prove the authenticity. Please see: [[Docs/SysAdmin/Security/GnuPG|GnuPG]] for more details.
 
{{prog|Urpmi}} must be run as root in order to install the packages. A clever but malicious person could possibly trick a not so clever Mageia user (I know that all the Mageia users are clever, but let's assume that there is one gullible Mageia user somewhere, just for the sake of the argument) to install a package that looks like a regular package used by many but that contains a Trojan Horse, some evil code. Once installed, the application may unleash some virus, worm or even some spyware... So far, there hasn't been any news of any such exploit having been attempted, but in a few years time, when GNU/Linux will be the most widely used OS, it is possible that some people would want to try to perform such a feat. Fortunately, they will fail, because a sane concern for security has always been part of the GNU/Linux community. Most packages are signed by the packagers to prove the authenticity. Please see: [[Docs/SysAdmin/Security/GnuPG|GnuPG]] for more details.
Line 462: Line 428:
 
Sometimes, when using {{prog|urpmi}}, people end up having rows of:
 
Sometimes, when using {{prog|urpmi}}, people end up having rows of:
  
<pre>
+
{{pre|<nowiki>rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
Line 471: Line 436:
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
+
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format</nowiki>}}
</pre>
 
  
 
It is unclear what the origin of the problem is: maybe the file has become corrupted during an upgrade or when an {{prog|urpmi}} process was killed by an impatient user.
 
It is unclear what the origin of the problem is: maybe the file has become corrupted during an upgrade or when an {{prog|urpmi}} process was killed by an impatient user.
Line 478: Line 442:
 
The solution is to remove the file rpmdb: {{file|/var/lib/rpm/Pubkeys}} and import the public keys again.
 
The solution is to remove the file rpmdb: {{file|/var/lib/rpm/Pubkeys}} and import the public keys again.
  
=== MD5 Hash ===
+
==== MD5 Hash ====
  
 
The MD5 hash is a code within the rpm package that lets {{prog|rpm}} checks whether the package hash is okay or not. If for any reason the file is corrupted, {{prog|rpm}} (and {{prog|urpmi}}) will refuse to install it; {{prog|rpmdrake}} will prompt the user whether or not it may proceed.
 
The MD5 hash is a code within the rpm package that lets {{prog|rpm}} checks whether the package hash is okay or not. If for any reason the file is corrupted, {{prog|rpm}} (and {{prog|urpmi}}) will refuse to install it; {{prog|rpmdrake}} will prompt the user whether or not it may proceed.
Line 484: Line 448:
 
Here is a recent example:
 
Here is a recent example:
  
<pre>
+
{{pre|<nowiki>[root@localhost yourusername]# urpmi kdesdk
[root@localhost yourusername]# urpmi kdesdk
 
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format
 
error: cannot open Pubkeys index using db3 - Invalid  
 
error: cannot open Pubkeys index using db3 - Invalid  
Line 498: Line 461:
 
(393221db35071aa90eaa73816a9a5ba8)
 
(393221db35071aa90eaa73816a9a5ba8)
 
unable to install package  
 
unable to install package  
/var/cache/urpmi/rpms/kdesdk-3.1.3-9mdk.i586.rpm
+
/var/cache/urpmi/rpms/kdesdk-3.1.3-9mdk.i586.rpm</nowiki>}}
</pre>
 
  
 
Notice the two lines <i>Invalid signature ((SHA1) DSA sha1 MD5 GPG GPG#70771ff3 NOT OK)</i> and <i>MD5 digest: BAD Expected(97f2ba5a91888cd3af40f89be6b65868) != (393221db35071aa90eaa73816a9a5ba8)</i>. The file kdesdk-3.1.3-9mdk.i586.rpm is corrupted and will not  be installed.
 
Notice the two lines <i>Invalid signature ((SHA1) DSA sha1 MD5 GPG GPG#70771ff3 NOT OK)</i> and <i>MD5 digest: BAD Expected(97f2ba5a91888cd3af40f89be6b65868) != (393221db35071aa90eaa73816a9a5ba8)</i>. The file kdesdk-3.1.3-9mdk.i586.rpm is corrupted and will not  be installed.
Line 509: Line 471:
 
It happens that the same corrupted file is mirrored in every FTP-server. If you've tried several servers and you always run into the same problem, check in a Mageia user forum or mailing list whether other users have the same problem with the same file. If this is the case, probably a new file will be released soon.
 
It happens that the same corrupted file is mirrored in every FTP-server. If you've tried several servers and you always run into the same problem, check in a Mageia user forum or mailing list whether other users have the same problem with the same file. If this is the case, probably a new file will be released soon.
  
= Troubleshooting =
+
== Troubleshooting ==
  
== RPM database locked ==
+
=== RPM database locked ===
  
 
If you get "urpmi database is locked" while trying to install a package, it usually means that another process is using the database. This could be for example:
 
If you get "urpmi database is locked" while trying to install a package, it usually means that another process is using the database. This could be for example:
Line 525: Line 487:
  
 
If the problem persists, then check what's using it, this command should do the job (as said above urpmi will display the command line of the process locking the urpmi database):
 
If the problem persists, then check what's using it, this command should do the job (as said above urpmi will display the command line of the process locking the urpmi database):
<pre>ps aux | grep rpm</pre>
+
{{pre|<nowiki>ps aux | grep rpm</nowiki>}}
 
you can kill the process but you must be cautious so as not to harm the urpmi/rpm database. e.g. if it's '''urpmi.update''', you can kill it, as this command only updates the urpmi database, and if it quits without finishing it'll update the db the next time it's run.
 
you can kill the process but you must be cautious so as not to harm the urpmi/rpm database. e.g. if it's '''urpmi.update''', you can kill it, as this command only updates the urpmi database, and if it quits without finishing it'll update the db the next time it's run.
  
=== Deleting the urpmi LOCK files manually is not recommended nor needed ===
+
==== Deleting the urpmi LOCK files manually is not recommended nor needed ====
 +
 
 
urpmi uses f-lock to lock the urpmi database when a urpmi process is running, this means that urpmi can detect if the LOCK files (''/var/lib/urpmi/.LOCK'' and ''/var/lib/rpm/RPMLOCK'') are "stale" (i.e. a process was running before and created the LOCK files but didn't exit cleanly and so didn't delete the LOCK files); when urpmi detects "stale" lock files it simply deletes them and creates new ones. So you should never need to delete those LOCK files manually, instead you should follow the above steps to investigate/fix the "urpmi database is locked" message, if you ever see it.
 
urpmi uses f-lock to lock the urpmi database when a urpmi process is running, this means that urpmi can detect if the LOCK files (''/var/lib/urpmi/.LOCK'' and ''/var/lib/rpm/RPMLOCK'') are "stale" (i.e. a process was running before and created the LOCK files but didn't exit cleanly and so didn't delete the LOCK files); when urpmi detects "stale" lock files it simply deletes them and creates new ones. So you should never need to delete those LOCK files manually, instead you should follow the above steps to investigate/fix the "urpmi database is locked" message, if you ever see it.
  
== Rebuild your database ==
+
=== Rebuild your database ===
  
 
If the database becomes inconsistent (an inconsistency can lead rpm to tell you that a "package is already installed" when it is actually not, and vice-versa) then you can rebuild the rpm database using this command:
 
If the database becomes inconsistent (an inconsistency can lead rpm to tell you that a "package is already installed" when it is actually not, and vice-versa) then you can rebuild the rpm database using this command:
Line 540: Line 503:
 
{{cmd|rpm -ivh --justdb --noscripts --notriggers}}
 
{{cmd|rpm -ivh --justdb --noscripts --notriggers}}
  
== The "medium contrib uses an invalid list" error ==
 
  
<pre>
+
=== Failed downloads ===
rm /var/lib/urpmi/list.contrib
+
 
</pre>
+
Failed downloads may hinder a successful update.
 +
 
 +
To remove bad rpm files use {{cmd|urpmi --clean}}.
 +
 
 +
Or use {{cmd|urpmi --resume}} to continue an interrupted download.
 +
 
 +
=== The "medium <medium_name> uses an invalid list" error ===
 +
 
 +
{{pre|rm /var/lib/urpmi/list.<medium_name>}}
  
 
This will stop the error from happening without interfering with package installation.
 
This will stop the error from happening without interfering with package installation.
  
== RPM package verification ==
+
=== RPM package verification ===
  
 
A really useful tool for checking a broken system is to verify the packages against the rpm database.
 
A really useful tool for checking a broken system is to verify the packages against the rpm database.
  
<pre>
+
{{pre|rpm -Va}}
rpm -Va
 
</pre>
 
  
This will tell you which packages have changed since you installed them (i.e. it lists all the ways in which your system is inconsistent with the rpm database) For example, if you have a power failure during boot, some files may become corrupt. (Or just if you have done something daft). Knowing this, you can fix your system to be as good as new by re-installing the packages concerned. (This can even be done on an un-bootable system, if you use a rescue CD to boot and fix it.)  
+
This will tell you which packages have changed since you installed them (i.e. it lists all the ways in which your system is inconsistent with the rpm database) For example, if you have a power failure during boot, some files may become corrupt. (Or just if you have done something daft). Knowing this, you can fix your system to be as good as new by re-installing the packages concerned. (This can even be done on an unbootable system, if you use a rescue CD to boot and fix it.)  
  
 
To check a single package use {{prog|rpm -V packagename}} (name is enough, version numbers etc. can be left out).
 
To check a single package use {{prog|rpm -V packagename}} (name is enough, version numbers etc. can be left out).
  
 
To reinstall a package, use the command:
 
To reinstall a package, use the command:
<pre>
+
{{pre|urpmi --replacepkgs packagename}}
urpmi --replacepkgs packagename
 
</pre>
 
 
You can also use the command {{prog|urpmi --no-install packagename}} to download the rpm file(s) without installation and then use:
 
You can also use the command {{prog|urpmi --no-install packagename}} to download the rpm file(s) without installation and then use:
<pre>
+
{{pre|rpm -i --replacepkgs /var/cache/urpmi/rpms/packagename.rpm}}
rpm -i --replacepkgs /var/cache/urpmi/rpms/packagename.rpm
 
</pre>
 
 
to install the package (assuming that packagename.rpm is the name of the rpm file).  
 
to install the package (assuming that packagename.rpm is the name of the rpm file).  
  
 
To verify one or more package's proper md5sum, hash and gpg signature:
 
To verify one or more package's proper md5sum, hash and gpg signature:
  
<pre>
+
{{pre|rpm -K foo.123.rpm, or rpm -K foo*}}
rpm -K foo.123.rpm, or rpm -K foo*
 
</pre>
 
  
== RPM sources ==
+
=== RPM sources ===
 
In order to work on sources files of a package, you can use urpmi to download the SRPMS rpm file:
 
In order to work on sources files of a package, you can use urpmi to download the SRPMS rpm file:
  
urpmi.addmedia core_src ftp://ftp.mirrror.com/mirror/mageia/distrib/6/SRPMS/core/release
+
{{pre|<nowiki>urpmi.addmedia core_src ftp://ftp.mirrror.com/mirror/mageia/distrib/6/SRPMS/core/release</nowiki>}}
  
 
and then you can install it:
 
and then you can install it:
  
urpmi --install-src packagename
+
{{pre|<nowiki>urpmi --install-src packagename</nowiki>}}
  
 
If you add --noclean, you will keep it on the rpm build top directory. Please notice that you don't need to be root to download the src.rpm, just type:
 
If you add --noclean, you will keep it on the rpm build top directory. Please notice that you don't need to be root to download the src.rpm, just type:
  
/usr/sbin/urpmi --install-src packagename
+
{{pre|<nowiki>/usr/sbin/urpmi --install-src packagename</nowiki>}}
  
 
and you will get the unpackaged SRPM in ~/rpmbuild . Now you can rebuild your binary.
 
and you will get the unpackaged SRPM in ~/rpmbuild . Now you can rebuild your binary.
  
rpm-build -bb ~/rpmbuild/SPECS/packagename.spec
+
{{pre|<nowiki>rpm-build -bb ~/rpmbuild/SPECS/packagename.spec</nowiki>}}
  
== Early bird slow ==
+
=== Early bird slow ===
  
 
If {{prog|msec}} is verifying your system it uses the {{prog|rpm}} database, but that is done at {{cmd|nice 19}}, and usually very early in the morning. On a slow box this can take a long time. If {{prog|ps -e}} shows {{prog|msec, rpmv, grep}} and {{prog|sort}} , you can speed up {{prog|rpmdrake}} / {{prog|urpmi}} by renicing {{prog|rpmw, grep }} and {{prog|sort}} to 0.
 
If {{prog|msec}} is verifying your system it uses the {{prog|rpm}} database, but that is done at {{cmd|nice 19}}, and usually very early in the morning. On a slow box this can take a long time. If {{prog|ps -e}} shows {{prog|msec, rpmv, grep}} and {{prog|sort}} , you can speed up {{prog|rpmdrake}} / {{prog|urpmi}} by renicing {{prog|rpmw, grep }} and {{prog|sort}} to 0.
  
= Upgrade to the latest Mageia version using {{prog|urpmi}} =
+
== Other places to learn more about urpmi ==
  
Urpmi can also be used to [[Upgrading_with_urpmi|upgrade]] your box to a newer version of Mageia: add the mirror's URL with the directory of the new versions packages to your urpmi configuration: {{menu|Mageia Control Center --> Software Management --> Select from where software packages are downloaded when updating the system}}
+
Below are other resources with more detailed information about urpmi:
  
= (More) cool tricks using {{prog|urpmi}} =
+
* Issue only the urpm* command itself to get a short help
 +
* {{prog|man}} pages: check the man pages for all the options. Those are the most up-to-date sources of information (Remember: they can also be opened in many browsers, just enter: {{cmd|man:urpmi}} in the addressfield).
 +
* Also read the instructions in the Mageia release notes for the version you want to upgrade to.
  
== Install from url or localfile ==
+
== See installed packages using rpm ==
  
{{prog|urpmi}} can be used to install local {{file|rpm's}} , and then resolve dependencies. For example, you just recompiled or created {{file|foo-1.0-1bar.rpm}} . You can easily use {{cmd|urpmi foo-1.0-1bar.rpm}} . It even works with http or ftp url (and even with ssh, provided that rsync is installed on both sides). If enabled {{prog|bash_completion}} will work very well on such commands.
+
* {{cmd|rpm -qa}} lists all installed packages. Pipe it through grep, i.e {{cmd|<nowiki>rpm -qa | grep drak</nowiki>}} to see all with "drak" in their name.
 +
* "What source package was drakrpm built from?" {{cmd|<nowiki>rpm -qif `which drakrpm`</nowiki>}}
  
== Getting a list of dependencies before installing ==
+
== Other ways to install programs in Mageia ==
 
 
By using {{prog|urpmq}} you can find out a lot of information about an rpm.
 
 
 
* {{cmd|urpmq -d}} gets a list of all rpm's that are needed to install one piece of software.
 
* {{cmd|urpmq -d bash}} see which rpm's are required.
 
* add the <b>{{cmd|-m}}</b> switch to see the ones not installed on the system at the moment.
 
* {{cmd|--sources}} will get the sources.
 
 
 
So, with {{cmd|urpmq -d -m --sources}} , you can easily get a list of url's that correspond to the rpm you need to get: quite handy if you lack a good connection to the internet.
 
 
 
== Getting information about an rpm ==
 
 
 
{{prog|urpmq -i}} can give you information about the rpm's you can install. Try {{prog|urpmq -i bash}}
 
 
 
= Installing non-rpm-packaged software =
 
 
 
Where possible, you should use {{prog|urpmi}} to install software, using packages from the correct {{prog|urpmi}} media for your current version of Mageia. Nearly everything you could want is available, if you have media enabled for nonfree and tainted: this is a way to avoid a great deal of pain! However, sometimes you may want to install a different package, or a more recent one than is available from the Mageia media.
 
 
 
The golden rule is, <b>never bypass the rpm package database</b>, if you can possibly help it, and never install a package forcibly. If you follow this rule, however annoying it may seem, you are guaranteed to never have a system in an inconsistent state. If {{prog|rpm/urpmi}} won't let you install something, there's usually a good reason! Preferably look for an rpmbuilt application and/or build an rpm yourself from a tarball that you find you should like to try on Mageia. There is help in this wiki for both (below !)
 
 
 
== Compiling from source ==
 
 
 
Instead of the familiar trilogy of:
 
 
 
<pre>
 
./configure
 
make
 
make install
 
</pre>
 
 
 
you can use {{prog|checkinstall}} to generate an rpm:
 
 
 
<pre>
 
./configure
 
make
 
checkinstall
 
</pre>
 
 
 
You will then get an rpm that can be installed using {{prog|urpmi}}, and can also be uninstalled when you want to.  If the tarball already includes a good spec file, it is even easier:
 
 
 
{{cmd|rpmbuild -tb ballname.tar.gz}}
 
 
 
== Rebuilding RPM'S ==
 
 
 
=== Built for another distro ===
 
 
 
An alien rpm can often be rebuilt for Mageia. Please refer to [[Packagers RPM tutorial]].
 
 
 
=== From a newer Mageia release ===
 
 
 
In Mageia development release "Cauldron", there may exist a newer version you need of a program.
 
 
 
You can then often download that rpm and rebuild it to suit the Mageia release you run, see [[How_to_do_your_own_backports]].
 
 
 
== The proprietary drivers ==
 
 
 
The proprietary drivers are shipped in the non-free media.  So always try the Mageia packages first.  I.e for Nvidia enable the nonfree and nonfree_backport repos, and in MCC when you configure your Nvidia video card you will be asked if you wan to use nouveau or the Nvidia driver.
 
''So you don't need to use the horrid Nvidia installer, which breaks all the above rules. The result works fine, but the process is not pleasant!''
 
 
 
== Installing binaries such as acrobat reader ==
 
 
 
These programs should end up in the {{file|/usr/local/}} directory. This directory is intended for non-official packages.
 
 
 
= Other places to learn more about {{prog|urpmi}} =
 
Below are other resources with more detailed information about urpmi:
 
 
 
* {{prog|man}} pages: check the man pages for all the options. Those are the most up-to-date sources of information (Remember: they can also be opened in many browsers, just enter: {{cmd|man:urpmi}} in the addressfield).
 
* [[Upgrading with urpmi]] discusses upgrading Mageia from one major version to another using urpmi.
 
  
= Other ways to install programs in Mageia =
+
See [[Ways to install programs]]
See [[Ways_to_install_programs]]
 

Latest revision as of 12:07, 22 December 2023


Drakconf multiflag.png
Other languages
Deutsch ; English ; Español ; Français ; Nederlands ;
Synopsis:
urpmi is Mageia's command line tool for managing packages and repositories (media). For example you can install, update or remove software packages with it. urpmi handles dependencies automatically i. e. it checks and resolves dependencies if necessary. For beginners the graphical tool rpmdrake is recommended over urpmi as rpmdrake is more user-friendly for inexperienced users.

Overview

In order to get a general idea of urpmi have a look at it's command line interface and some basic use cases:

The command line interface

The command line interface of urpmi is subdivided into the following basic commands:

Command Description
urpmi Install or update a package
urpme Remove a package
urpmq Search for packages or information about packages
urpmf Search for packages which contain a given file
urpmi.update Update a repository/medium i. e. update the list of available packages on the local system
urpmi.addmedia Add a new repository/medium to the local system
urpmi.removemedia Remove a repository/medium from the local system


Common use cases

The following lists provide a brief overview of some common use cases of urpmi:

Basic commands: Install, remove, update

Command Description
urpmi PKG.. Install or update the specified package(s). PKG can also point to a local RPM file which will be installed then. If no matching package is found then a search will be performed and suggestions will be displayed.
urpme PKG.. Remove the specified package(s) and all packages which depend on it. If there is no package named PKG, a search will be performed and suggestions will be displayed.
urpmi --auto-update Update all: Update all media first (like urpmi.update -a (see below)) and automatically select packages which can be updated and install them (like urpmi --auto-select).

Media/Repository commands

Command Description
urpmi.update -a Update all media i. e. update the local list of available packages
urpmi.update MED.. Update the specified media i. e. update its local list of available packages.
urpmq --list-url Show all repositories and their URLs.
urpmq --list-media active Show all active repositories
urpmq --list-media active --list-url Show all active repositories and their URLs
urpmi.addmedia NAME URL Add a new media with NAME and URL.
urpmi.removemedia NAME Remove media.

Search commands

Command Description
urpmq PKG Search a package by its exact name (the search term PKG and the package name have to match exactly).
urpmq --summary -Y PKG Search a package by its name and display a summary of the package. The option -Y disables the case-sensivity and enables the fuzzy search mode (packages are found if the search phrase and the package name match partially).
urpmq -i PKG Display information about a package. PKG could also point to a local RPM file.
urpmq --requires PKG Display the dependencies of a package.
urpmf FILE Search for packages that contain a file named FILE

urpmi.addmedia

This is where the whole thing starts. You add a software repository (a.k.a. medium, mirror) using the urpmi.addmedia command. The format for adding a new repository is as follows:

urpmi.addmedia nameofmedia ftp://ftp.site.com/path/to/Mageia/RPMS

but effectively you are working behind the scenes juggling the same as if you are using drakrpm-edit-media which is the GUI in Mageia Control Center under Software Management --> Select from where software packages are downloaded when updating the system

Mageia mirrors for final release versions contain at least the following repositories (media):

  • core repositories which contains free and open source software
  • nonfree repositories which contains some proprietary software
  • tainted repositories which contains software which may be subject to patent claims in some countries

Here is some other explanations about these categories.

Each media has five sub-medias:

  • release the packages as of the release day.
  • updates the packages updated since the release day for security or bug concerns, or important updates (i.e web browsers). Everyone should have this medium, even with a very slow internet connection. When adding an update medium, add the --update switch so urpmi can distinguish it from a regular medium.
  • update testing which is used for temporary tests of new updates, to allow the bug reporters to validate the corrections.
  • backports some packages of new versions backported from Cauldron, or updates that may need manual assistance so they can not be in updates (i.e Nextcloud server)
  • backports testing which is used for temporary tests of new backports, to allow the bug reporters to validate the corrections.

Please see Mirrors policy for a complete overview of the mirror structure which can be found on most mirrors.


Copying CD or a DVD to a home directory and using the copy in urpmi

If you don't like using the CD or a DVD when updating your system and you have room to spare in your harddrive, make a directory (for example: /home/uid/repo/), copy the x86_64/media or i586/media directories recursively from the CD or DVD there. After removing the install CD or DVD open a terminal/console and type as root:

cd /home/uid/repo genhdlist2

Now you can add the media, either via urpmi.addmedia:

urpmi.addmedia --distrib HD file://home/uid/repo

Or use the media manager via Mageia Control Center --> Software Management --> Select from where software packages are downloaded when updating the system to set up your new directory and disable all the CD or DVD entries.

Copying RPM's (including install CD or DVD) to a single directory and using the copy in urpmi

Make a directory, for example ~/RPMS, to hold all the RPM's. Then in order to copy a bunch of RPM's (from the install CD or DVD, for example) you type:

find /INSTALL_CD/ -name *.rpm -print -exec cp {} ~/RPMS \;

If you have copied the install CD or DVD to the hard drive, or have their ISO images on the drive (see Copy CD or DVD to Hard Drive on how to mount them), this can be done in one step.

In this example, the CD or DVD were mounted as /INSTALL_CD/.

cd ~/RPMS genhdlist2

It will then create a hdlist.cz file and a sythesis.hdlist.cz file based on what it finds in the directory it is in.

Find the pubkeys for the RPM's and copy them into ~/RPMS/pubkey. They should be in INSTALL_CD/media/media_info :

mkdir ~/RPMS/pubkey cp /INSTALL_CD/media/media_info/pubkey* ~/RPMS/pubkey/

then as root add the medium:

urpmi.addmedia local_rpms file://home/uid/RPMS/

Adding media for a distribution

urpmi can add important media (e.g. core, nonfree, tainted ...) from a chosen mirror with a single command. As root type in a terminal/console:

urpmi.addmedia --distrib ftp://'MIRROR_SITE'/mirror/mageia/distrib/'VERSION'/'ARCH'

in which:

  • 'MIRROR_SITE' is the actual URL of the FTP-server
  • 'VERSION' is the current or other version of your Mageia for which you want to the add the media
  • 'ARCH' is one of: i586 or x86_64, or possibly others that do not exist for all Mageia versions (for example sparc, pcc, etc.)

Manually choosing a mirror

Mirrors are listed at https://mirrors.mageia.org/ -choose one close to you (in internet route measures)

The status page https://mirrors.mageia.org/status help in avoiding bad mirrors.

Selecting mirror automatically using aria2

It is possible to automatically select mirrors using the --mirrorlist option. This command will add important medias selecting the mirrors automatically :

urpmi.addmedia --distrib --mirrorlist '$MIRRORLIST'

Finding mirrors near you using rsync and urpmi to update

Please see: https://wiki.mageia.org/en/Finding_Mageia_rsync_servers

urpmi.update

The urpmi.update command updates the list of packages from a package repository. This list changes whenever the packages in the server change, so you need to update it whenever you want to install a new package from a changeable repository, like Mageia Cauldron (Be very careful with Cauldron packages; they might work but installing them usually does cause problems further down the road on a stable version!). If you are using a repository for a final release, it normally does not change, so you do not need to update the list whenever you install.

To update all enabled media, use

urpmi.update -a

To update specific media(s):

urpmi.update nameofmedia1 nameofmedia2 ...

i.e one specific media: urpmi.update 'Nonfree 32bit Updates', or two: urpmi.update 'Nonfree 32bit Updates' 'Nonfree Updates'. Note the citation marks.

Actually it match the given names to any media, so urpmi.update Upd will update all medias containing "Upd", i.e all updates media - even them that are not enabled!

Sometimes you would like to Install from non enabled media, i.e Backports, and to update all configured media including non enabled, a trick is to use

urpmi.update e

It works because the words core, nonfree, and tainted, all have the letter e in them ;)

urpmi.removemedia

If you want to get rid of a repository, this is the command to use:

urpmi.removemedia nameofmedia

To remove all repositories:

urpmi.removemedia -a

urpmf

With urpmf you can find any file that you may want, know what package it belongs to, see a description of the package and a bunch of other things.

Note that it only search within enabled medias, see #urpmq.

Suppose that you want to compile a C program on your box and the compiler complains about jpeglib.h missing. All that you have to do is:

urpmf jpeglib.h

That will output, for example:

libjpeg62-devel:/usr/include/jpeglib.h mozilla-devel:/usr/include/mozilla-1.4a/jpeg/jpeglib.h

This means that the jpeglib header file is part of the package libjpeg62-devel, and can now be installed with:

urpmi libjpeg62-devel

Another example: you might want to install a mail client, but you don't know any mail client for Linux. So you want to perform a search on the summary of the packages, for terms 'mail' and 'client'. The command

urpmf --summary mail -a client returns:

evolution:Integrated GNOME mail client, calendar and address book. squirrelmail:Squirrelmail is a webmail client for PHP4. sylpheed-claws:Enhanced version of the Sylpheed e-mail client comsat:A mail checker client and comsat mail checking server. cscmail:CSCMail is a GTK email client written in Perl sylpheed:A GTK+ based, lightweight, and fast e-mail client tradeclient:Email Client with PIM features for X

The --summary option is used to perform a search on the summary, and the -a switch translates 'and'.

urpmi

This is the main package management command, which you use to install the package you want as well as the packages that it depends on:

urpmi nameofpackage

For instance, if you think that Sylpheed is a good e-mail client because it describes itself as 'lightweight', you install it with: urpmi sylpheed.

Caveat: doing urpmi nameofpackage usually but not necessarily results in the latest version of that package being installed. Urpmi will compare the version number of the installed package with that in the enabled media. The exception is that when an upgrade of a package is made available under a slightly different name while both the old and the new version remain available in the enabled media. It is sometimes necessary to do so for reasons of backward compatibility.

Here is a notable example urpmi autoconf will not result in the latest version being installed, for the highest version of that package name is autoconf2.5-2.60.

You should use the command urpmi autoconf2.5 instead, which will give you the latest 2.5*. Note that on your Mageia system, both versions should be installed: Mageia will automatically choose the one that is most appropriate. See /usr/share/doc/autoconf-2.13/IMPORTANT.README.MDK for more information on this particular example.

See several remarks about urpmq --fuzzy below to learn how to avoid such versioning problems.

System update

Another example of using urpmi is to update your system with the latest security updates/bugfixes:

# urpmi --auto-update

The command above brings the system up-to-date do the same as the following command sequence:

# urpmi.update -a && urpmi --auto-select

The && characters mean "IF the first command succeeds, then perform the second command". The first command (urpmi.update -a) updates for all media the list of available software packages. The second command (urpmi --auto-select) selects all available updates of already installed packages and initiates the update process. Urpmi will list the upgradeable packages and ask if you wish to proceed. If you want to proceed, just type y for yes or n for no and then press Enter. When the update-process is finished installing you'll get a new prompt at the bottom.

If you prefer using a graphical user interface ('GUI') use rpmdrake in the Mageia Control Center: Software Management --> Look at available updates and apply any fixes or upgrades to installed packages

System upgrade to the latest Mageia version

Urpmi can also be used to upgrade your system to a newer release of Mageia.

In short:

Remove old mirror set:

# urpmi.removemedia -a

Add new release mirror set (here as example Mageia 9):

# urpmi.addmedia --distrib --mirrorlist 'http://mirrors.mageia.org/api/mageia.9.$ARCH.list'

Start upgrading:

# urpmi --auto-update --auto --force

Important: Before starting, do read the more comprehensive instruction in Release Notes!

(And as usual also browse through rest of Release Notes and Errata.)

Also see How to choose the right Mageia upgrade method.

urpmi --parallel pushes updates to machines in your network

Updates are downloaded to one of the machines and from there pushed to the others on your network

urpmi --parallel will update all machines you specify. See man urpmi for more and man urpmi.files, as well as: http://www.happyassassin.net/2005/05/04/a-quick-guide-to-urpmi-parallel .

urpmi parallel mode does what it sounds like: you run an urpmi command and it happens on many machines in parallel. In more detail - the machine you run the command on tests its result on each machine in the group in turn, downloads all necessary packages for all machines in the group, distributes the appropriate packages to each machine, then calls urpmi on the machine to do the actual installation. It's brilliant for quickly installing software on all your machines, or even keeping them all up-to-date with a couple of commands, and it saves on bandwidth, as each necessary package is downloaded only once. The only drawback at the moment is that you cannot include the server machine in the group, which makes it a little less good for small home networks.

(An alternate and more flexible way may be to install urpmi-proxy http://wiki.mageia.org/en/Urpmi-proxy on one of your machines that is up most of the time. Then direct all Mageia systems (including the one that runs urpmi-proxy) to retrieve packages from that machine. That machine will then retrieve packages that any other machine asks for, and cache them, so when another machine asks for the same it is quickly retrieved from cache.)

So how to use urpmi --parallel? It's pretty simple, really. First, make sure you can ssh from the server to each client machine as root (you have to enter a passphrase or password, but can be you set up to use keys and make use of ssh-add to avoid that). Now install urpmi-parallel-ssh on the server machine. Edit /etc/urpmi/parallel.cfg to look like this:

local:ssh:toy:htpc

the first parameter is the name of the group, make this whatever you like. Leave the second as ssh. The remaining parameters are the hostnames of the machines in the group; as many as you like (but not the server machine: urpmi will just fall over its own lock files).

Next, you can use it. On the server machine, run:

urpmi --parallel local somepackage

As long as urpmi on the server has an access to all packages required by all client machines from its urpmi media, everything should now work smoothly. The easiest way to ensure this is to have all machines - server and client - use the same urpmi media.

Install from non enabled media, i.e Backports

In order to not install backported packaged by mistake, you should not have backport media enabled.

You can tell urpmi to install from a non enabled media anyway, just when you want to.

(Of course, the media need to be configured and updated, see urpmi.update)

Here is an example to install gnucash from Backports testing

urpmi --search-media 'Backports Testing' gnucash

urpme

This is the command that uninstalls software from your box. As with urpmi, it works out the dependencies and tells you if any software that's still installed depends on what you want to uninstall, giving you the chance to abort the procedure or to uninstall the package and those that depend on it. Usage is:

urpme nameofpackage

For instance, if Sylpheed is so good that you want to get rid of Evolution, your former e-mail client, you can make some place on your hard drive with urpme evolution.

Advanced usage

For removing all apparently unused packages, or for removing a whole task like a desktop environment, see Removing packages.

Do beware the warnings about possibly removing too much!

urpmq

By using urpmq you can find out a lot of information about an rpm.

  • urpmq -i can give you information about the rpm's you can install. Try urpmq -i bash
  • urpmq -d gets a list of all rpm's that are needed to install one piece of software.
  • urpmq -d bash see which rpm's are required.
  • add the -m switch to see the ones not installed on the system at the moment.
  • --sources will get the sources.
  • So, with urpmq -d -m --sources , you can easily get a list of url's that correspond to the rpm you need to get: quite handy if you lack a good connection to the internet.
  • urpmq --list-media list all configured media, including inactive media.

To list only the active medias, add "active" on the command line, and you can add option "--list-url" to see where they are fetched from:

$ urpmq --list-media active --list-url
Core Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/core/release Core Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/core/updates Nonfree Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/nonfree/release< Nonfree Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/x86_64/media/nonfree/updates Core 32bit Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/core/release Core 32bit Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/core/updates Nonfree 32bit Release http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/nonfree/release Nonfree 32bit Updates http://ftp.acc.umu.se/mirror/mageia/distrib/7.1/i586/media/nonfree/updates

This example is a 64 bit system with 32 bit medias enabled, and no tainted.

To edit media, launch media configuration drakrpm-edit-media, (alternatively use Mageia Control Center). If you wish to also select or deselect a media for updates (i.e you are running cauldron), issue drakrpm-edit-media --expert.

Note:
* urpmq only search active repositories - You have to configure and make active full distribution medias for urpmq to be able to find all of our packages.
  • Use 32 bit repos on 64 bit systems only if needed (i.e for Steam), and if any package from a 32 bit repo have been installed, keep that repo and its update repo enabled in order to not potentially hinder future updates.
  • Tainted repos contain programs that may be encumbered by patents, check legality in your country.
  • Backport basically only contain packages backported from next Mageia.
Warning!
When using urpmq to look for packages, make sure you understand the difference between using it with or without the option --fuzzy. You might miss some packages you were looking for if you are not careful. If urpmq finds a package with the exact name than the one you queried, it will return this package only and by default, you will not see other packages which include the same name.

For example: Imagine your best pal told you about 0ad, a real-time strategy (RTS) game of ancient warfare.

$ urpmq -r 0ad
0ad-0.0.23b-16.mga8 0ad-0.0.25-1.mga8 0ad-0.0.25b-1.mga8 0ad-0.0.25b-1.1.mga8

Great! There is a Mageia package with this exact name! But you don't see other packages which include this name! So we query again: notice the missing 'd' at the end of the package name:

$ urpmq -r 0a
No package named 0a

This time the query result is very different: We see not one but two packages. Compare the following query to the previous two.

$ urpmq -r --fuzzy 0ad
0ad-0.0.25b-1.1.mga8 0ad-data-0.0.25b-1.mga8

urpmq -r --fuzzy is also great to see what other available version there may be to a package: sometimes a new major version does not provide full backward compatibility. For this reason, the newer version will be distributed under a slightly different package name. Now, you are sure not to miss anything.

$ urpmq -r --fuzzy fvwm
fvwm-crystal-3.7.0-1.mga8 fvwm2-2.6.9-4.mga8 fvwm2-config-mageia-2.6.9-4.mga8 fvwm2-doc-2.6.9-4.mga8 fvwm3-1.0.2-1.1.mga8 fvwm3-config-mageia-1.0.2-1.1.mga8 fvwm3-doc-1.0.2-1.1.mga8 task-fvwm2-1-7.mga8

You see: the new release is packaged in another name (name including increasing version number)

Using Graphical interfaces

gurpmi

gurpmi is the graphical front-end for urpmi and can be used on the commandline to install/search a package from a medium or at the prompt. It is also used by rpmdrake to display messages that need user interaction.

rpmdrake

Mageia offers a set of nice graphical tools to perform the same tasks. Rpmdrake is the one called from Mageia Control Center to Add/Remove programs. There you also start an update and select repositories. See our official documentation.

manatools

A not yet complete rewrite of Mageia Control Center, added in Mageia 5 Try mpan or mana to launch.

dnfdragora

DNF is the rising star in package management. Dnfdragora is the graphical interface.

See Using DNF how to set up and use it, and note the current caveats.

A question of security

What are the security issues

Urpmi must be run as root in order to install the packages. A clever but malicious person could possibly trick a not so clever Mageia user (I know that all the Mageia users are clever, but let's assume that there is one gullible Mageia user somewhere, just for the sake of the argument) to install a package that looks like a regular package used by many but that contains a Trojan Horse, some evil code. Once installed, the application may unleash some virus, worm or even some spyware... So far, there hasn't been any news of any such exploit having been attempted, but in a few years time, when GNU/Linux will be the most widely used OS, it is possible that some people would want to try to perform such a feat. Fortunately, they will fail, because a sane concern for security has always been part of the GNU/Linux community. Most packages are signed by the packagers to prove the authenticity. Please see: GnuPG for more details.

Besides a malicious person trying to trick you into installing their malware, what is more likely to happen is that you try to install some package that got corrupted, either during ftp transfer, or because of a scratch on your installation CD/DVD... Before installing, urpmi will check the integrity of the package using the MD5 Hash code and the included gpg package key. See relevant section below for details.

Sometimes, when using urpmi, people end up having rows of:

rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format

It is unclear what the origin of the problem is: maybe the file has become corrupted during an upgrade or when an urpmi process was killed by an impatient user.

The solution is to remove the file rpmdb: /var/lib/rpm/Pubkeys and import the public keys again.

MD5 Hash

The MD5 hash is a code within the rpm package that lets rpm checks whether the package hash is okay or not. If for any reason the file is corrupted, rpm (and urpmi) will refuse to install it; rpmdrake will prompt the user whether or not it may proceed.

Here is a recent example:

[root@localhost yourusername]# urpmi kdesdk rpmdb: /var/lib/rpm/Pubkeys: unexpected file type or format error: cannot open Pubkeys index using db3 - Invalid argument (22) The following packages have bad signatures: /var/cache/urpmi/rpms/kdesdk-3.1.3-9mdk.i586.rpm: Invalid signature ((SHA1) DSA sha1 MD5 GPG GPG#70771ff3 NOT OK) Do you want to continue installation ? (y/N) y installing /var/cache/urpmi/rpms/kdesdk-3.1.3-9mdk.i586.rpm error: /var/cache/urpmi/rpms/kdesdk-3.1.3-9mdk.i586.rpm: MD5 digest: BAD Expected(97f2ba5a91888cd3af40f89be6b65868) != (393221db35071aa90eaa73816a9a5ba8) unable to install package /var/cache/urpmi/rpms/kdesdk-3.1.3-9mdk.i586.rpm

Notice the two lines Invalid signature ((SHA1) DSA sha1 MD5 GPG GPG#70771ff3 NOT OK) and MD5 digest: BAD Expected(97f2ba5a91888cd3af40f89be6b65868) != (393221db35071aa90eaa73816a9a5ba8). The file kdesdk-3.1.3-9mdk.i586.rpm is corrupted and will not be installed.

The solution is to remove the file from /var/cache/urpmi/rpms/ and download it again. Try again to install it with urpmi or rpm --import <filename>

If it still does not work, it means that your mirror has a corrupted file. Try downloading it manually from two or three other mirrors and save it in the /var/cache/urpmi/rpms/ folder. Always manually remove the previously downloaded file before attempting to use another mirror. Then install it again with urpmi.

It happens that the same corrupted file is mirrored in every FTP-server. If you've tried several servers and you always run into the same problem, check in a Mageia user forum or mailing list whether other users have the same problem with the same file. If this is the case, probably a new file will be released soon.

Troubleshooting

RPM database locked

If you get "urpmi database is locked" while trying to install a package, it usually means that another process is using the database. This could be for example:

  • One of the Mageia software management applications:
    • rpmdrake aka "Install & remove software"
    • drakrpm-edit-media aka "Configure media sources for install & update"
  • mgaapplet, the update applet, updating the urpmi database in the background (this is the applet responsible for the icon in the system tray notifying the users of the availability of updates)
  • A urpmi/rpm process installing or uninstalling a package

Starting from the Mageia 1 release urpmi will display the whole command line of the process using the urpmi database, that makes it easier to identify it.

If you are sure you have not started any other urpmi commands or software management windows then it's probably mgaapplet updating the urpmi database and checking for updates in the background. Simply wait a while, and try again.

If the problem persists, then check what's using it, this command should do the job (as said above urpmi will display the command line of the process locking the urpmi database):

ps aux | grep rpm

you can kill the process but you must be cautious so as not to harm the urpmi/rpm database. e.g. if it's urpmi.update, you can kill it, as this command only updates the urpmi database, and if it quits without finishing it'll update the db the next time it's run.

Deleting the urpmi LOCK files manually is not recommended nor needed

urpmi uses f-lock to lock the urpmi database when a urpmi process is running, this means that urpmi can detect if the LOCK files (/var/lib/urpmi/.LOCK and /var/lib/rpm/RPMLOCK) are "stale" (i.e. a process was running before and created the LOCK files but didn't exit cleanly and so didn't delete the LOCK files); when urpmi detects "stale" lock files it simply deletes them and creates new ones. So you should never need to delete those LOCK files manually, instead you should follow the above steps to investigate/fix the "urpmi database is locked" message, if you ever see it.

Rebuild your database

If the database becomes inconsistent (an inconsistency can lead rpm to tell you that a "package is already installed" when it is actually not, and vice-versa) then you can rebuild the rpm database using this command: rpm --rebuilddb

* It is a good idea to regularly back up your /var/lib/rpm directory. Then you can always revert to a previously good database and reinstall the packages that came later with:

rpm -ivh --justdb --noscripts --notriggers


Failed downloads

Failed downloads may hinder a successful update.

To remove bad rpm files use urpmi --clean.

Or use urpmi --resume to continue an interrupted download.

The "medium <medium_name> uses an invalid list" error

rm /var/lib/urpmi/list.<medium_name>

This will stop the error from happening without interfering with package installation.

RPM package verification

A really useful tool for checking a broken system is to verify the packages against the rpm database.

rpm -Va

This will tell you which packages have changed since you installed them (i.e. it lists all the ways in which your system is inconsistent with the rpm database) For example, if you have a power failure during boot, some files may become corrupt. (Or just if you have done something daft). Knowing this, you can fix your system to be as good as new by re-installing the packages concerned. (This can even be done on an unbootable system, if you use a rescue CD to boot and fix it.)

To check a single package use rpm -V packagename (name is enough, version numbers etc. can be left out).

To reinstall a package, use the command:

urpmi --replacepkgs packagename

You can also use the command urpmi --no-install packagename to download the rpm file(s) without installation and then use:

rpm -i --replacepkgs /var/cache/urpmi/rpms/packagename.rpm

to install the package (assuming that packagename.rpm is the name of the rpm file).

To verify one or more package's proper md5sum, hash and gpg signature:

rpm -K foo.123.rpm, or rpm -K foo*

RPM sources

In order to work on sources files of a package, you can use urpmi to download the SRPMS rpm file:

urpmi.addmedia core_src ftp://ftp.mirrror.com/mirror/mageia/distrib/6/SRPMS/core/release

and then you can install it:

urpmi --install-src packagename

If you add --noclean, you will keep it on the rpm build top directory. Please notice that you don't need to be root to download the src.rpm, just type:

/usr/sbin/urpmi --install-src packagename

and you will get the unpackaged SRPM in ~/rpmbuild . Now you can rebuild your binary.

rpm-build -bb ~/rpmbuild/SPECS/packagename.spec

Early bird slow

If msec is verifying your system it uses the rpm database, but that is done at nice 19, and usually very early in the morning. On a slow box this can take a long time. If ps -e shows msec, rpmv, grep and sort , you can speed up rpmdrake / urpmi by renicing rpmw, grep and sort to 0.

Other places to learn more about urpmi

Below are other resources with more detailed information about urpmi:

  • Issue only the urpm* command itself to get a short help
  • man pages: check the man pages for all the options. Those are the most up-to-date sources of information (Remember: they can also be opened in many browsers, just enter: man:urpmi in the addressfield).
  • Also read the instructions in the Mageia release notes for the version you want to upgrade to.

See installed packages using rpm

  • rpm -qa lists all installed packages. Pipe it through grep, i.e rpm -qa | grep drak to see all with "drak" in their name.
  • "What source package was drakrpm built from?" rpm -qif `which drakrpm`

Other ways to install programs in Mageia

See Ways to install programs