urpmi.addmedia
Add a new media source for urpmi
TLDR
Add a medium
Add a medium from a hard drive (run genhdlist2 in the directory first)
Add important media from a chosen mirror
Automatically select mirrors from a mirror list
SYNOPSIS
urpmi.addmedia [OPTIONS] media_name media_url
urpmi.addmedia [OPTIONS] media_name --mirrorlist mirrorlist_url
urpmi.addmedia --list-media
urpmi.addmedia --remove-media media_name
PARAMETERS
media_name
A unique identifier for the new media, used to refer to it in URPMI commands.
media_url
The URL or path to the repository, e.g., ftp://ftp.example.com/pub/mageia/distrib/cauldron/x86_64 or file:///mnt/cdrom.
-c, --clear
Clears all existing media configurations before adding the new one. Use with extreme caution as it removes all previously defined repositories.
-U, --update
Updates an existing media's URL or other properties without removing and re-adding it. The media_name must already exist.
-a <architecture>, --arch <architecture>
Specifies the architecture for the media, e.g., i586 or x86_64. Useful for multi-architecture systems.
-p <priority>, --priority <priority>
Assigns a priority to the media. Lower numbers indicate higher priority, influencing which media is preferred when multiple sources offer the same package.
-M <url>, --mirrorlist <url>
Uses a mirror list URL to automatically select the best mirror for the media. The URL points to a file containing a list of mirrors.
--distrib <name>
Specifies the distribution name for the media, if different from the default.
-s <type>, --sort <type>
Sorts mirrors (when using --mirrorlist) based on the specified type (e.g., by_latency).
-v, --verbose
Increases the verbosity of the command output, showing more details about the operation.
--debug
Outputs extensive debugging information, useful for troubleshooting.
--urpmi-root <path>
Specifies an alternative root directory for URPMI operations, useful for chroot environments.
--no-verify-rpm
Disables RPM signature verification for packages from this media. Use with caution as it reduces security.
--list-media
Lists all currently configured URPMI media, their URLs, and properties. Does not require media_name or media_url.
--remove-media <media_name>
Removes the specified media from the URPMI configuration. This is an alternative to the urpmi.removemedia command.
--help
Displays a help message with command usage and options.
--version
Displays the version information for the urpmi.addmedia command.
DESCRIPTION
The urpmi.addmedia command is a crucial utility within the URPMI package management system, primarily used by Mageia and Mandriva Linux distributions. Its purpose is to register new software repositories, known as "media," into the system's package configuration. These media can be local sources like CD/DVDs or local directories, or remote sources accessed via protocols such as HTTP, FTP, or rsync. By adding a media, you inform URPMI where to look for packages, enabling the installation of new software or updates for existing ones. It allows users to expand the available software catalog beyond the default configured sources. After adding a media, it is common practice to run urpmi.update or urpmi --auto-select to refresh the package list and make the new packages available for installation. This command effectively manages the system's URPMI configuration file, typically /etc/urpmi/urpmi.cfg, which stores the definitions of all known media.
CAVEATS
Requires root privileges to modify system-wide URPMI configuration files.
This command is specific to URPMI, primarily found in Mageia and Mandriva Linux distributions. It is not available in Debian/Ubuntu (APT) or Fedora/RHEL (DNF/YUM) based systems.
Always ensure the media_url points to a reliable and trustworthy source to maintain system security and stability.
After adding or modifying media, it is strongly recommended to run urpmi.update to refresh the package database and make the new packages available.
Using the --clear option will remove ALL existing media, which can leave your system without any package sources if not followed by immediate re-addition of essential repositories.
LISTING CURRENT MEDIA
To view all currently configured media, their names, URLs, and associated properties (like priority or architecture), use the command: urpmi.addmedia --list-media. This provides a quick overview of your system's package sources.
REMOVING MEDIA
While urpmi.removemedia is a dedicated command, urpmi.addmedia also provides the functionality to remove a configured media. To remove a specific media by its name, use: urpmi.addmedia --remove-media <media_name>. This option removes the entry from the URPMI configuration, preventing future package lookups from that source.
MEDIA CONFIGURATION FILE
The configuration for all URPMI media is typically stored in the file /etc/urpmi/urpmi.cfg. While urpmi.addmedia manages this file automatically, advanced users might occasionally inspect or manually edit it for specific needs, though direct manual editing is generally discouraged in favor of using the URPMI tools.
HISTORY
The urpmi.addmedia command is an integral part of the URPMI package management suite, which was originally developed for Mandrake Linux (later Mandriva Linux) in the late 1990s as an alternative to RPM's native tools. Its design aimed to simplify package installation and dependency resolution. urpmi.addmedia specifically emerged to provide an intuitive way for users to manage their software sources, ranging from local CD-ROMs to various network-based repositories. With the discontinuation of Mandriva, URPMI and its associated tools, including urpmi.addmedia, have been carried forward and actively maintained by the Mageia Linux project, ensuring its continued development and usage for repository management.
SEE ALSO
urpmi(8), urpmi.update(8), urpmi.removemedia(8), urpmi.cfg(5)