| Other languages Deutsch ; English ; Español ; Français ; 简体中文 ; |
Contents
- 1 Preamble
- 2 Install and Setup
- 3 Some commands to get started
- 4 Short command variants of common commands
- 5 Graphical interface
- 6 Warning about orphans mechanisms
- 7 Removing URPMI updater applet
- 8 DNF updater applet
- 9 Upgrade Mageia release using DNF
- 10 Setting up a container for a non-native architecture
- 11 Documentation
Preamble
Now that Feature:Add DNF as Alternate Repository Manager is almost done, it is possible to start using it. Before starting using DNF, do read Warning about orphans mechanisms below, and have a search in our Bugzilla. At the end of this document there are links to manuals.
Install and Setup
- install
dnf: (it is normally installed by default)
urpmi dnf
- If nonfree or tainted repositories are desired, they can be activated using
dnf config-manageras shown with this example for 64 bit system (replace x86_64 with i586 for 32 bit):
dnf config-manager --set-enabled mageia-x86_64-nonfree updates-x86_64-nonfree dnf config-manager --set-enabled mageia-x86_64-tainted updates-x86_64-tainted
- 32-bit repositories are turned off by default on 64-bit x86. If you need them:
dnf config-manager --set-enabled mageia-i586 updates-i586
Repeat similarly (see previous example) if you also need nonfree and tainted.
- For Cauldron, replace "mageia" with "cauldron" and "updates", "backports", etc. with "cauldron-updates", "cauldron-backports", etc respectively in the above commands.
- If you wish to override the mirror selection with your preferred mirror, you can do so by editing the repository config files in
/etc/yum.repos.d. Uncomment the "baseurl=" line and change the URL to point to your preferred mirror. This will automatically override the "metalink" and "mirrorlist" properties so that it will use the designated mirror. If you want, you can comment out the "metalink=" and "mirrorlist=" entries if you want, but that will eliminate the failover mechanism that occurs when the "primary" mirror isn't functioning.
Some commands to get started
As root:
dnf install ri-liinstalls ri-lidnf reinstall ri-lireinstalls ri-lidnf downgrade ri-lidowngrades ri-lidnf remove ri-liremoves ri-lidnf makecacherefreshes the metadata (what is available in the repos)dnf check-update --refreshrefreshes the metadata and checks for new updatesdnf upgrade --refreshrefreshes metadata and does all available updatesdnf upgrade --bestforces attempts to select best available versions, which can help in determining dependency errorsdnf distro-sync --refreshrefreshes the metadata and synchronizes the package set installed on the computer with versions in the repositoriesdnf distro-sync --allowerasing --bestwill help to upgrade a package with changed major, like e.g. lib64clang3.8 to lib64clang3.9dnf history listshows the install/remove/upgrade history listdnf history info 12shows what happened during item 12 from the history listdnf shellinvokes the interactive shell for doing multiple actions as one transactiondnf install --enablerepo updates_testing-x86_64 cajainstalls a package (for caja) from a specific repository (updates_testing-x86_64)
As user (or root):
dnf helpshows a help pagednf search faxreturns all packages with "fax" in the name or summarydnf repolistshows last metadata check, the enabled repos and their size. First it downloads any yet not downloaded.
Short command variants of common commands
Starting with DNF 2.6.2, there are now short abbreviations for commonly used commands:
As root:
dnf in ri-liinstalls ri-lidnf ri ri-lireinstalls ri-lidnf dg ri-lidowngrade ri-lidnf rm ri-liremoves ri-lidnf mcrefreshes the metadata (what is available on the repos)dnf updoes all available updatesdnf dsyncsynchronizes the package set installed on the computer with versions in the repositoriesdnf shinvokes the interactive shell for doing multiple actions as one transaction
As user (or root):
dnf se faxreturns all packages with "fax" in the name or summary
If you have a non-English system and need the output in English, then put LANGUAGE=C on the same line before the command.
Graphical interface
Install: dnf in dnfdragora
Launch: Mageia menu > Tools > System tools > dnfdragora. ( Or in terminal issue dnfdragora )
Quirk: mga#21453 - dnfdragora does not remember packages source selection.
Warning about orphans mechanisms
Mixing use of URPMI and DNF renders orphan mechanisms of both of them unreliable.
If you are going to use DNF, please switch to it as soon as possible after a fresh install.
Removing URPMI updater applet
Uninstall mgaonline.
DNF updater applet
Install dnfdragora-updater.
Upgrade Mageia release using DNF
You can upgrade Mageia in just a few steps. Note all commands must be run as root.
- Ensure you're fully up to date:
dnf --refresh upgrade - Install the system-upgrade plugin:
dnf install 'dnf-command(system-upgrade)' - Start it:
dnf system-upgrade --releasever <targetversion> download --allowerasing. For example, to upgrade to Mageia 8, use8for<targetversion>.- It will ask before downloading packages, and report how much space is required. If you do not have what it says plus a couple of hundred MB free space on
/varpartition (if/varis not separate but part of/partition, add another couple hundred MB), then either make enough space or add the option--downloaddir path_to_directory_with_free_spaceto this and the next system-upgrade commands. Also make sure/has additional room for the larger new programs. Note that maybe there needs to be room for not just one, but two kernels (see Extra kernel flavour below). Especially if you have a separate/bootpartition, check there is enough room for that. - When you know you have sufficient space, say yes to let it download. It will also dry run a transaction test.
- It will ask before downloading packages, and report how much space is required. If you do not have what it says plus a couple of hundred MB free space on
- If the downloading and transaction test succeeded,
- Save your work, and close applications!
- Trigger the upgrade:
dnf system-upgrade reboot
| Warning! /!\ NOTE: This immediately reboots your system! /!\ |
Now enjoy some beverage while looking at the bubbles on our boot splash - and above it, messages detailing what is happening. When done, it will reboot, allowing you enjoy your new Mageia.
Extra kernel flavour
DNF uses a different method to select kernel flavour than Mageia installer. This may result in that a system that was using the desktop kernel, can end up with both desktop and server installed after upgrade by DNF, and server being used. Easy fix: select at boot the desktop kernel, then uninstall server kernel. mga#28272
Setting up a container for a non-native architecture
Starting with DNF 2.6.2, it is now possible to build chroots or containers for foreign architectures.
The procedure for creating an ARMv7 chroot on an x86_64 system is as follows:
- Install
qemu-user-staticon the host system - Restart
systemd-binfmt.serviceto have new binary format information to take effect - Create the directory of your foreign arch chroot. For example
/var/lib/machines/mga8armv7hl - Run DNF as root to create the installroot:
dnf --installroot=/var/lib/machines/mga8armv7hl --releasever=8 --forcearch=armv7hl --repofrompath=mga8rel,http://mirrors.kernel.org/mageia/distrib/8/armv7hl/media/core/release/ --repofrompath=mga8up,http://mirrors.kernel.org/mageia/distrib/8/armv7hl/media/core/updates/ --disablerepo=* --enablerepo=mga8rel --enablerepo=mga8up --setopt=install_weak_deps=False install basesystem-minimal-core dnf
Finally, test the chroot to see if a program runs. Here's a suggested command (run as root): chroot /var/lib/machines/mga8armv7hl /usr/bin/uname -r -m