Rabu, 29 Agustus 2007

URPMI Usage

To install packages on your Mandrake system, you use the urpmi command. The urpmi command will install the requested package(s) along with any dependencies they may require. There are many options that can be used with the urpmi command, I’ll start with a couple examples using the most common options, to give you an idea on the syntax used, and then list all the options. Keep in mind that urpmi is a root command and needs to be run as the root user.
The most common use of urpmi is installing a single package. An example of this is as follows:
Code:
[root@box root]# urpmi mozilla-firefox
The above command will install mozilla-firefox and any dependencies it may require.
You can also install multiple packages at a time by using the following:
Code:
[root@box root]# urpmi mozilla-firefox mozilla-thunderbird gcal
The above command would install those 3 packages and any dependencies required by them.
Another commonly used urpmi command is for updating every package on the system and is as follows:
Code:
[root@box root]# urpmi –auto-select –auto
As you can see, combining options is allowed.
The following are other options that can be used with the urpmi command:
-a With this option, if multiple packages are found matching the request, urpmi will install all of them.
–allow-force When using this option, if an error occurs, urpmi will ask the user if it should continue the installation without checking dependencies. This is not advised and is why urpmi’s default is to exit immediately.
–auto This option allows urpmi to install all required dependencies without stopping and asking if it’s ok to do so. Often used in combination with the –auto-select option.
–auto-select This option looks at your installed packages, looks at what is available in your defined media sources, and then updates any packages that it finds a newer version for.
–best-output This option will cause urpmi to try and use the X interface, if not available, the standard text (cli) interface is used (using rpm-like output).
–bug directory This option creates a bug report and puts it in directory. You have to send a compressed archive of the directory to the urpmi maintainer for the bug to be reported and accepted properly.
–clean This option clears the cache of any rpm’s there. The cache is located in /var/cache/urpmi/rpms
–curl This option causes urpmi to use curl to download the package(s). Using curl is the default.
–env directory Use a different environment directly from a bug report to replay a bug. The directory argument is the as given to the –bug option.
–excludedocs This option will cause the document files to not be installed.
–excludemedia media1,…,mediaN This option causes urpmi not to look at the specified media source(s).
–excludepath string This option will cause urpmi to not install files whose name begins with the defined string.
–force Using this option causes urpmi to assume yes on all questions.
–fuzzy This option will propose all packages partially matching the name given, even if one of the packages matches the given name exactly. (This is the same as -y).
–install-src This installs only the source package (no binary packages will be installed). Note: From what I can tell this option is no longer valid due to mandrake mirrors no longer being setup for urpmi use with the SRPM tree.
–keep With this option, if some dependancies cannot be satisfied, it’ll change the selection of packages in an attempt to keep the existing packages instead of removing them. This generally rejects the upgrade of packages when a dependency error occurs.
–limit-rate rate This option tries to limit the download speed. The rate is given in butes/sec. By default, this option is not active.
–media media1,…,mediaN With this option, urpmi will only look at the specified media for the package(s). Default is to look in all media sources.
–noclean This option causes the downloaded rpm’s to not be removed from the cache directory /var/cache/urpmi/rpms. Default is to remove downloaded/installed rpm’s from cache.
–no-uninstall This option causes urpmi to never ask to uninstall a package, instead it simply aborts. This can be safer in auto mode.
-p This option allows urpmi to search in provides to find a package. This is the default behavior.
-P This option does not allow urpmi to search in provides to find a package. (This is the opposite of the -p option).
–parallel alias This option activates distributed execution of urpmi to other machines. The other machines MUST have urpmi installed on them, but they are not required to have any media sources defined on them. the alias defines which extension module is to be used by urpmi (urpmi-parallel-ka-run or urpmi-parallel-ssh are available) and which machines should be updated. The alias is defined in the file /etc/urpmi/parallel.cfg
–proxy proxyhost[:port1080] Use this option if you need to specify HTTP proxy.
–proxy-user user:password Use this option to specify a user and password for proxy authentication.
-q This option causes quiet mode. When calling rpm no upgrade status will be displayed.
–root directory With this, all operations and scripts will run after chroot(2) and use the file system tree rooted to for rpm install. The rpm database that resides in the rooted tree will be used, but the urpmi configuration from the normal system tree will be used.
-s This option is the same as –src.
–sort-media media1,..mediaN With this option, you specify the order in which media sources should be sorted and looked at by urpmi.
–split-length count This option will split urpmi’s operation into small transactions of at least count packages. The default setting is 1. Setting this to 0 disables splitting into small transactions.
–split-level number This option will split urpmi’s operation into small transactions when the total number of packages to upgrade is greater than the given number. This option is activated by default with a value of 20.
–src name This option will search a source package matching the given name and select all of its dependencies by default, unless –install-src is used in order to install the source package itself. Note: From what I can tell this option is no longer valid due to mandrake mirrors no longer being setup for urpmi use with the SRPM tree.
–synthesis file This option will use the specified file instead of the urpmi database to use in searching for packages and resolving dependencies.
–test This option will cause urpmi to ‘test’ the installation of package(s) but not install the package(s) or modify the system in any way.
–update This option causes urpmi to only look for package(s) and resolve dependencies using media source(s) defined as update source(s). This was defined when adding the media source(s).
-v This option causes urpmi to be more verbose in its output.
–verify-rpm This option will activate or deactivate rpm signature checking. By default this is activated.
–wget By default is used by urpmi for downloading, this option allows you to specify that wget is used instead of curl.
-X This option causes urpmi to use the X interface, meaning it will open a gui window in the X environment.
-y This option is the same as the –fuzzy option.
–update This option causes urpmi to look for the requested package(s) only in the media source defined as an update source.
Other methods of using urpmi
urpmi http://www.some.url/filename.rpm This command will allow you to retrieve and install a rpm from a web site. Dependency resolving will still take place.
urpmi some.filename.rpm This command allows you to install an rpm that you have previously downloaded. You must run the command in the same directory as the rpm file. Dependency resolving still takes place.