Urpm-tools

From Rosalab Wiki
Revision as of 17:11, 4 October 2012 by D uragan (Talk | contribs) (urpm-repomanage: + '-b' option)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Urpm-tools is a set of utilities for manipulating urpmi repositories.

Urpm-tools are partially based on yum-utils but significantly extends their functionality. For convenience, utilities from urpm-tools have similar names as their analogues from yum-utils and the same options for the same actions.

Installation

1. Add media where the newest version of urpm-tools can be found.

For 32-bit system run:

sudo urpmi.addmedia akirilenko_personal http://abf.rosalinux.ru/downloads/akirilenko_personal/repository/rosa2012lts/i586/main/release/

For 64-bit system run:

sudo urpmi.addmedia akirilenko_personal http://abf.rosalinux.ru/downloads/akirilenko_personal/repository/rosa2012lts/x86_64/main/release/

2. Install urpm-tools package

sudo urpmi urpm-tools

List of Tools

Tool Description
urpm-downloader download binary, source or debuginfo packages with all dependencies (this tool combines functionality of yum-downloader and debuginfo-install from yum-utils)
urpm-package-cleanup manage package cleanup - look for duplicates and outstanding dependency problems
urpm-repoclosure detect unresolved dependencies in repository
urpm-repodiff compare two or more repositories, returns a list of added, removed or changed packages
urpm-repograph generate a full package dependency graph for repository in dot format
urpm-repomanage analyze a directory of rpm packages, return a list of newest or oldest packages
urpm-reposync synchronize with remote repository (analogue of distrosync from yum-utils)

For completeness, one should note that some possibilities provided by yum-utils and other auxiliary yum tools are already supported by urpmi & co.:

Yum Tool Urpmi analogue Description
yum-builddep urpmi --buildrequires install packages required to build given SRPM (using the package itself or its spec file)
createrepo genhdlist2 create repository from a set of packages
repoquery urpmq query repository for package information (in the similar way like rpm queries local rpmdb)

See also: Package Manager Options

urpm-downloader

A tool for downloading RPMs from Urpmi repositories

Usage:

urpm-downloader.py [-h] [-u] [-r] [-a] [-b] [-s] [-d] [-D] [--version]
                          [-v] [-q]
                          [--include-media INCLUDE_MEDIA [INCLUDE_MEDIA ...]]
                          [--exclude-media EXCLUDE_MEDIA [EXCLUDE_MEDIA ...]]
                          [-x EXCLUDE_PACKAGES [EXCLUDE_PACKAGES ...]] [-i]
                          [-o] [--all-alternatives] [--all-versions]
                          [--dest-dir DEST_DIR]
                          packages [packages ...]

positional arguments:
  packages              Package name(s) to download. It can contain not only
                        package names, but (S)RPM files too. In this case
                        package name extracted from this file will be used

optional arguments:
  -h, --help            show this help message and exit
  -u, --urls            Instead of downloading files, list the URLs that would
                        be processed
  -r, --resolve         When downloading RPMs, resolve dependencies and also
                        download the required packages, if they are not
                        already installed
  -a, --resolve-all     When downloading RPMs, resolve dependencies and also
                        download the required packages, even if they are
                        already installed
  -b, --binary          Download binary RPMs
  -s, --source          Download the source RPMs (SRPMs)
  -d, --debug-info      Download debug RPMs
  -D, --debug-info-install
                        Download debug RPMs and install
  --version             show program's version number and exit
  -v, --verbose         Verbose (print additional info)
  -q, --quiet           Quiet operation.
  --include-media INCLUDE_MEDIA [INCLUDE_MEDIA ...], --media INCLUDE_MEDIA [INCLUDE_MEDIA ...]
                        Use only selected URPM media
  --exclude-media EXCLUDE_MEDIA [EXCLUDE_MEDIA ...]
                        Do not use selected URPM media
  -x EXCLUDE_PACKAGES [EXCLUDE_PACKAGES ...], --exclude-packages EXCLUDE_PACKAGES [EXCLUDE_PACKAGES ...]
                        Exclude package(s) by regex
  -i, --ignore-errors   Try to continue when error occurs
  -o, --overwrite       If the file already exists, download it again and
                        overwrite the old one
  --all-alternatives    If package dependency can be satisfied by several
                        packages, download all of them (by default, only the
                        first one is downloaded)
  --all-versions        If different versions of package present in
                        repository, process them all
  --dest-dir DEST_DIR   Specify a destination directory for the download

If none of the options -b, -s, -d turned on, it will be treated as -b

urpm-package-cleanup

Find problems in the rpmdb of system and correct them.

The tool can perform the following actions:

  1. Look for situation when multiple versions of the same package are installed; the tool can automatically uninstall all versions except the latest one.
    • There is a separate check for kernel packages; it takes into account running kernel and never tries to uninstall it, and in addition allows to specify number of kernels that should be left in the system.
  2. Look for installed packages that are not available in any configured repository (this is just a wrapper for `urpmq --not-available`).
  3. Look for installed packages that have unmet dependencies.
  4. List "leaf" nodes in the local RPM database. Leaf nodes are RPMs that are not relied upon by any other RPM.

Usage:

urpm-package-cleanup.py [-h] [--qf QF] [--auto] [--version] [--orphans]
                               [--update] [--media media [media ...]]
                               [--excludemedia media [media ...]] [--problems]
                               [--suggests] [--dupes] [--cleandupes]
                               [--noscripts] [--leaves] [--all]
                               [--leaf-regex LEAF_REGEX] [--exclude-devel]
                               [--exclude-bin] [--oldkernels]
                               [--count KERNELCOUNT] [--keepdevel]

optional arguments:
  -h, --help            show this help message and exit
  --qf QF, --queryformat QF
                        Query format to use for output.
  --auto                Use non-interactive mode
  --version             show program's version number and exit

Orphans Options:
  --orphans             List installed packages which are not available from
                        currently configured repositories
  --update              Use only update media. This means that urpmq will
                        search and resolve dependencies only in media marked
                        as containing updates (e.g. which have been created
                        with "urpmi.addmedia --update").
  --media media [media ...]
                        Select specific media to be used, instead of
                        defaulting to all available media (or all update media
                        if --update is used). No rpm will be found in other
                        media.
  --excludemedia media [media ...]
                        Do not use the specified media.

Dependency Problems Options:
  --problems            List dependency problems in the local RPM database
  --suggests            List missing suggestions of installed packages

Duplicate Package Options:
  --dupes               Scan for duplicates in your rpmdb
  --cleandupes          Scan for duplicates in your rpmdb and remove older
  --noscripts           disable rpm scriptlets from running when cleaning
                        duplicates

Leaf Node Options:
  --leaves              List leaf nodes in the local RPM database
  --all                 list all packages leaf nodes that do not match leaf-
                        regex
  --leaf-regex LEAF_REGEX
                        A package name that matches this regular expression
                        (case insensitively) is a leaf
  --exclude-devel       do not list development packages as leaf nodes
  --exclude-bin         do not list packages with files in a bin dirs as leaf
                        nodes

Old Kernel Options:
  --oldkernels          Remove old kernel and kernel-devel packages
  --count KERNELCOUNT   Number of kernel packages to keep on the system
                        (default 2)
  --keepdevel           Do not remove kernel-devel packages when removing
                        kernels

urpm-repoclosure

A tool to check dependency closure in the repository.

Usage:

  urpm-repoclosure.pl --hdlist=hdlist.txt
  urpm-repoclosure.pl --hdlist=http://mirror.yandex.ru/mandriva/.../synthesis.hdlist.cz
  urpm-repoclosure.pl --dir=rpms/ --static --file-deps=file-deps.txt
  urpm-repoclosure.pl --list=list.txt --dynamic

OPTIONS:
  -h|-help
      Print this help.

  -v|-version
      Print version information.

  -hdlist <path>
      Path or URL of HDlist (synthesis) to check.

  -d|-dir <path>
      The directory with RPM packages to check.

  -l|-list <path>
      The list of packages to check.

  -file-deps <path>
      Read file-deps to ignore some unresolved
      dependencies.

  -s|-static
      Check statically if all required dependencies are
      satisfied by provided dependencies in the set of
      RPM packages.

  -dynamic
      Install a set of RPM packages to the local chroot
      and check if extra packages were installed.

  -r|-check-release
      Check installation media (DVD).

  -sign|-check-signature
      Validate package signatures.

  -noclean
      Do not clean urpmi cache.

  -root <path>
      Where to install packages.
      Default:
          /tmp/...

EXIT CODES:
      0 - Suceess. The tool has run without any errors
      non-zero - Failed or the tool has run with errors. In particular:
      1 - Failed to run the tool
      2 - Discovered dependency problems

urpm-repodiff

Take 2 or more repositories and return a list of added, removed and changed packages.

Usage:

urpm-repodiff.py [-h] --old OLD_REPO [OLD_REPO ...] --new NEW_REPO
                        [NEW_REPO ...] [--size] [--simple] [--quiet] [--html]
                        [--output OUTPUT_FILE]

optional arguments:
  -h, --help            show this help message and exit
  --old OLD_REPO [OLD_REPO ...], -o OLD_REPO [OLD_REPO ...]
                        URL or PATH to old repositories
  --new NEW_REPO [NEW_REPO ...], -n NEW_REPO [NEW_REPO ...]
                        URL or PATH to new repositories
  --size, -s            Show differences in package sizes.
  --simple              Simple output format.
  --quiet, -q           Hide service messages.
  --html                Output in HTML format, if --output is not present HTML
                        will be created in current directory. --size and
                        --simple options are ignored.
  --output OUTPUT_FILE, -out OUTPUT_FILE
                        Change standart output to "OUTPUT_FILE".

urpm-repograph

Generate a full package dependency graph for repository in dot format

Usage:

urpm-repograph.py [-h] [--cross CROSS_REPO [CROSS_REPO ...]] [--quiet]
                         [--verbose] [--requires] [--suggests] [--file]
                         [--unprovided]
                         [--requires-recursive PKG | --whatrequires PKG]
                         [--loops | --alternatives | --broken] [--different]
                         [--output OUTPUT_FILE | --nograph]
                         REPOSITORY

positional arguments:
  REPOSITORY            URL or local PATH to repository.

optional arguments:
  -h, --help            show this help message and exit
  --cross CROSS_REPO [CROSS_REPO ...], -c CROSS_REPO [CROSS_REPO ...]
                        Search for cross-repository references in
                        CROSS_REPO(s) repositories.
  --quiet, -q           Hide service messages. (About progress status etc.)
  --verbose, -v         Show warnings. (About unprovided packages etc.)
  --requires, -r        Process "requires" package dependencies. Used by
                        default.
  --suggests, -s        Process "suggests" package dependencies. If used
                        without --requires then only suggests dependencies are
                        processed.
  --file, -f            Process file dependencies.
  --unprovided, -u      Show unprovided dependencies.
  --requires-recursive PKG
                        Search for packages, which are required by package PKG
                        (PKG is a file name or package name)
  --whatrequires PKG    Search for packages, which requires package PKG (PKG
                        is a file name or package name)
  --loops, -l           Search for all simple loops of cycled dependecies.
  --alternatives, -a    Search for alternative packages providing the same
                        feature.
  --broken, -b          Search for all broken packages and anything beetween
                        them
  --different, -d       Output each loop or each alternative in different
                        file. Ignored if --loops or --alternatives options are
                        not present. OUTPUT_FILE (if present) is tracted as
                        folder name for new files in that case.
  --output OUTPUT_FILE, -o OUTPUT_FILE
                        Change graph output to "OUTPUT_FILE". STDIN by
                        default.
  --nograph, -n         Do not output graph. Tool will not start working if
                        --quiet, --nograph are present and --verbose is not.
                        (If there is nothing to output - then nothing has to
                        be done.)

urpm-repomanage

Manage a directory of rpm packages and report newest or oldest packages

Usage:

urpm-repomanage.py [-h] [-o | -n | -b] [-r] [-s] [-k KEEP] [-c] [-q | -V]  path

manage a directory of rpm packages and report newest or oldest packages

positional arguments:
  path                  path to directory with rpm packages

optional arguments:
  -h, --help            show this help message and exit
  -o, --old             print the older packages
  -n, --new             print the newest packages (this is the default
                        behavior)
  -b, --obsolete        print obsolete packages
  -r, --remove-old      remove older packages
  -s, --space           space separated output, not newline
  -k KEEP, --keep KEEP  number of newest packages to keep - defaults to 1
  -c, --nocheck         do not check package payload signatures/digests
  -q, --quiet           be completely quiet
  -V, --verbose         be verbose - say which packages are decided to be old
                        and why (this info is dumped to STDERR)

urpm-reposync

Synchronize installed package base with remote repository

Usage:

urpm-reposync.py        [-h]
                        [--include-media INCLUDE_MEDIA [INCLUDE_MEDIA ...]]
                        [--exclude-media EXCLUDE_MEDIA [EXCLUDE_MEDIA ...]]
                        [-v] [-q] [-a] [-p] [-d] [-r] [-c] [-k]
                        [--runselftests] [--detailed]

reposync is used to synchronize a set of packages on the local computer with
the remote repository.

optional arguments:
  -h, --help            show this help message and exit
  --include-media INCLUDE_MEDIA [INCLUDE_MEDIA ...], --media INCLUDE_MEDIA [INCLUDE_MEDIA ...]
                        Use only selected URPM media
  --exclude-media EXCLUDE_MEDIA [EXCLUDE_MEDIA ...]
                        Do not use selected URPM media
  -v, --verbose         Verbose (print additional info)
  -q, --quiet           Quiet operation. Senseless without --auto.
  -a, --auto            Do not ask questions, just do it!
  -p, --printonly       Only print the list of actions to be done and do
                        nothing more!
  -d, --download        Only download the rpm files, but install or remove
                        nothing.
  -r, --remove          Remove all the packages which do not present in
                        repository. By default, only some of them would be
                        removed.
  -c, --check           Download packages and check wether the ycan be
                        installed to your system, but do not install them.
  -k, --nokernel        Do nothing with kernels.
  --runselftests        Run self-tests end exit.
  --detailed            Show detailed information about packages are going to
                        be removed or installed (why does it have to be done)