[MAQeia] Software / package management hints
Posted: Jan 17th, '13, 23:58
For software management under Mageia in general please have a look at the documentation:
Documentation about software management in Mageia wiki
Documentation about software management for beginners in Mageia wiki
Documentation about software management in Mageia Control Center (aka MCC)
Other useful commands related to package management, in no particular order:
List history of installed packages since the installation of Mageia:
A more fine-grained history (for all packages since Mageia installation) including which program triggered installation/removal can be seen with the following command run as root (or grant your user journalctl permissions, just add your user to the systemd-journal group)
same as above, but limited to all packages installation/removal since the last two boots:
To list active repos:
To list all configured repos including disabled repos:
To list all configured repos and their URLs:
or
Those can also be combined:
If instead of an URL you see something about mirrorlist, the following command will show the first 5 mirrors it will try (sorting ascending by geological proximity)
Mirrorlist is a mechanism which takes a list of all available Mageia mirrors (which can be seen at http://mirrors.mageia.org/ ) and, using geolocation, tries to automatically choose those mirrors first which are near you current location and give the fastest reponses. This may not work always that well, as some mirrors sync not that often.
To enable media (e.g. nonfree&tained _release and _updates repos) use urpmi.update --no-ignore followed by urpmi.update -a. All in one:
To query the URL on mirror for a given package name, use
To search in package names, and ignore case sensitivity (urpmi does respect case by default) use
To configure your repos from one particular mirror and not use mirrorlist, use the following commands to remove all repositories and add a complete set of repositories from one specific mirror (in the example ftp.nluug.nl is used )
To show all packages, which are currently installed but not available from the currently configured repositories (good way to show 3rd party packages or libaries/packages that don't exist anymore, e.g. after a distro version upgrade
To check dependencies of all installed packages (similar to yum check command)
To download all installed packages (or all packages from a textfile, but they must be currently installed - simply replace /var/log/rpmpkgs with the path to that file)
To download packages from a list, which are not currently isntalled
check viewtopic.php?f=7&t=6901 for more information about this.
To search for a package name or part of a package name, and to show the full name and version for the packages in the results and in which repository those packages are contained
Tell urpmi to be verbose, useful in case of package installation/update errors to see the underlying dependency solver and why it really fails or does not what you expect it to do
To debug circular dependencies, since Mageia 4 there is a new option to help with that:
To simply mark all orphaned packages as manually installed, one can use e.g.
WARNING: This is only listed here for completeness' sake, see https://wiki.mageia.org/en/Removing_packages for more details regarding orphans, context information and also a tool for orphan management
To install all required packages to build a given src.rpm one can also use urpmi (also on remote packages, as rpm can do it too)
To print the full URL to any given packages
To skip any packages during updates/installation
To skip packages permanently, add them into /etc/urpmi/skip.list - for more details see also man urpmi.files
Also see
Documentation about software management in Mageia wiki
Documentation about software management for beginners in Mageia wiki
Documentation about software management in Mageia Control Center (aka MCC)
Other useful commands related to package management, in no particular order:
List history of installed packages since the installation of Mageia:
- Code: Select all
rpm -qa --last
A more fine-grained history (for all packages since Mageia installation) including which program triggered installation/removal can be seen with the following command run as root (or grant your user journalctl permissions, just add your user to the systemd-journal group)
- Code: Select all
journalctl -a --no-pager | grep -F "[RPM]"
same as above, but limited to all packages installation/removal since the last two boots:
- Code: Select all
journalctl -a -b-2 --no-pager | grep -F "[RPM]"
To list active repos:
- Code: Select all
urpmq --list-media active
To list all configured repos including disabled repos:
- Code: Select all
urpmq --list-media
To list all configured repos and their URLs:
- Code: Select all
urpmq --dump
or
- Code: Select all
urpmq --list-url
Those can also be combined:
- Code: Select all
urpmq --list-media active --list-url
If instead of an URL you see something about mirrorlist, the following command will show the first 5 mirrors it will try (sorting ascending by geological proximity)
- Code: Select all
grep url /var/cache/urpmi/mirrors.cache | head -5
Mirrorlist is a mechanism which takes a list of all available Mageia mirrors (which can be seen at http://mirrors.mageia.org/ ) and, using geolocation, tries to automatically choose those mirrors first which are near you current location and give the fastest reponses. This may not work always that well, as some mirrors sync not that often.
To enable media (e.g. nonfree&tained _release and _updates repos) use urpmi.update --no-ignore followed by urpmi.update -a. All in one:
- Code: Select all
urpmi.update --no-ignore "Tainted Release" && urpmi.update --no-ignore "Tainted Updates" && urpmi.update --no-ignore "Nonfree Release" && urpmi.update --no-ignore "Nonfree Updates" && urpmi.update -av
To query the URL on mirror for a given package name, use
- Code: Select all
urpmq --sources packagename
To search in package names, and ignore case sensitivity (urpmi does respect case by default) use
- Code: Select all
urpmf -i --name packagename
To configure your repos from one particular mirror and not use mirrorlist, use the following commands to remove all repositories and add a complete set of repositories from one specific mirror (in the example ftp.nluug.nl is used )
- Code: Select all
urpmi.removemedia -a
urpmi.addmedia --distrib 'ftp://ftp.nluug.nl/pub/os/Linux/distr/mageia/distrib/$VERSION/$ARCH'
To show all packages, which are currently installed but not available from the currently configured repositories (good way to show 3rd party packages or libaries/packages that don't exist anymore, e.g. after a distro version upgrade
- Code: Select all
urpmq --not-available
To check dependencies of all installed packages (similar to yum check command)
- Code: Select all
rpm -Va --nodigest --nofiles --noscripts --nosignature --nolinkto --nofiledigest --nosize --nouser --nogroup --nomtime --nomode --nordev
To download all installed packages (or all packages from a textfile, but they must be currently installed - simply replace /var/log/rpmpkgs with the path to that file)
- Code: Select all
for pkg in $(cat /var/log/rpmpkgs | sed 's/.rpm$//'); do urpmi --replacepkgs --no-install ${pkg};done
To download packages from a list, which are not currently isntalled
- Code: Select all
for pkg in $(cat file_with_rpm_filenames | sed 's/.rpm$//'); do urpmi --download-all --force --no-install ${pkg};done
check viewtopic.php?f=7&t=6901 for more information about this.
To search for a package name or part of a package name, and to show the full name and version for the packages in the results and in which repository those packages are contained
- Code: Select all
urpmf -f --name -m part_of_packagename
Tell urpmi to be verbose, useful in case of package installation/update errors to see the underlying dependency solver and why it really fails or does not what you expect it to do
- Code: Select all
urpmi --debug
To debug circular dependencies, since Mageia 4 there is a new option to help with that:
- Code: Select all
urpmi --deploops
To simply mark all orphaned packages as manually installed, one can use e.g.
- Code: Select all
urpmi $(urpmq --auto-orphans)
WARNING: This is only listed here for completeness' sake, see https://wiki.mageia.org/en/Removing_packages for more details regarding orphans, context information and also a tool for orphan management
To install all required packages to build a given src.rpm one can also use urpmi (also on remote packages, as rpm can do it too)
- Code: Select all
urpmi --buildrequires http://ftp.nluug.nl/pub/os/Linux/distr/mageia/distrib/cauldron/SRPMS/core/release/2mandvd-1.8.4-6.mga4.src.rpm
To print the full URL to any given packages
- Code: Select all
urpmi --sources packagename
To skip any packages during updates/installation
- Code: Select all
urpmi --skip packagename
To skip packages permanently, add them into /etc/urpmi/skip.list - for more details see also man urpmi.files
Also see
- Code: Select all
man urpmihowto