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.
|
Contents
[hide]- 1 Overview
- 2 urpmi.addmedia
- 2.1 Copying CD or a DVD to a home directory and using the copy in urpmi
- 2.2 Copying RPM's (including install CD or DVD) to a single directory and using the copy in urpmi
- 2.3 Adding media for a distribution
- 2.4 Manually choosing a mirror
- 2.5 Selecting mirror automatically using aria2
- 2.6 Finding mirrors near you using rsync and urpmi to update
- 3 urpmi.update
- 4 urpmi.removemedia
- 5 urpmf
- 6 urpmi
- 7 urpme
- 8 urpmq
- 9 Using Graphical interfaces
- 10 A question of security
- 11 Troubleshooting
- 12 Other places to learn more about urpmi
- 13 See installed packages using rpm
- 14 Other ways to install programs in Mageia
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 softwarenonfree repositories
which contains some proprietary softwaretainted 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 sourpmi
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. Tryurpmq -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:
This example is a 64 bit system, default medias, with 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.
|
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.
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:
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
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.
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 https://mirror.accum.se/mirror/mageia/distrib/9/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.erpm -qa | grep drak
to see all with "drak" in their name.- "What source package was drakrpm built from?"
rpm -qif `which drakrpm`