From Fedora Project Wiki

No edit summary
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{header|docs}}
{{header|docs}}{{Docs_beat_open}}
{{Docs_beat_open}}
 
[[Category:Docs Project]]
[[Category:Docs Project]]
[[Category:Draft documentation]]
[[Category:Draft documentation]]
[[Category:Documentation beats]]
[[Category:Documentation beats]]
== yum replaced by dnf ==
The `yum` package manager has been replaced in Fedora 22 by its successor, dnf.  The yum fork has been available in Fedora for testing since Fedora 18, and is now the default command line package manager.
Most dnf commands use directives that are familiar to yum users, and it uses the same RPM package repositories.  Behind the scenes, dnf uses an improved dependency solver, `hawkey`, along with `librepo` for repository operations and `libcomps` for package groups.
=== dnf behavior ===
The behavior of dnf differs from yum in some areas:
==== Updates that don't work are skipped ====
If a portion of a transaction is not viable, dnf will automatically exclude it and transparently continue with the portions that will work.  For example, if a package has unmet dependencies during a `dnf update` action, that package will not be updated, but others will.  This is similar to yum's "--skip-broken" directive, but evaluates the impact of the problem against the entire transaction.  Because this is the default behavior, there is no "--skip-broken" switch for dnf.
To review details about a problematic package direction, you can use the "--best" option. `dnf update --best` will force dnf to resolve the transaction using the latest versions of involved packages, and report any problems instead of skipping them.
==== Repos that don't work are skipped ====
If a configured and enabled repository does not respond, dnf will skip it and continue the transaction with the available repos.  This differs from yum, which would immediately stop if a repository was not available.
==== Update and Upgrade are the same ====
The commands `dnf update` and `dnf upgrade` are equivalent.  This  differs from yum, where `yum upgrade` would have the same effect as `yum update --obsoletes`, and take obsolete packages into account.
==== Dependencies are not upgraded on package installation ====
When installing a new package, previously installed dependencies will not be upgraded.  Yum offered an option for this behavior, '''upgrade_requirements_on_install'''.  To upgrade with dnf, use `dnf update`.
==== Clean on remove ====
When removing a package, dnf will automatically remove any dependent packages that were not explicitly installed by the user.  If a package was independently installed, it won't be uninstalled this way.
This behavior is configured by the "clean_requirements_on_remove" option in /etc/dnf/dnf.conf.
==== Repo cache refresh schedule ====
By default, dnf will check for updates in configured repositories hourly, starting ten minutes after the system boots.  The action is controlled by a systemd timer unit, /usr/lib/systemd/system/dnf-makecache.timer. 
To adjust this, copy the timer file to /etc/systemd/system/dnf-makecache.timer and edit it.
Alternatively, setting the '''metadata_timer_sync''' in /etc/dnf/dnf.conf to a number of seconds configures the minimum number of seconds between makecache operations.  If the timer has not expired, `dnf makecache` will exit immediately.
dnf will also honor the '''metadata_expire''' option set in individual repo configs, and refresh repo metadata at runtime if it is too old.  This option is described in `man yum.conf`.
==== Repository Actions =====
The "repository-packages" directive can be used to search for or get info about packages in a specific repository, list installed packages frrom that repository, and more.  This simplifies operations that would have required use of "--excluderepo" and "--includerepo" options with yum, and is especially useful for managing similar packages from different repositories.
==== Listing dependencies ====
To find out what package supplies a particular provide, use the `dnf provides foo` command.  This replaces `yum resolvedep foo`.
To list the dependencies of a package, use `dnf repoquery --requires foo`.  This replaces `yum deplist foo`.
==== dnf will remove kernels ====
kernel packages are not protected by dnf.  Unlike with yum, you can remove all kernel packages, including the running package, if you direct it to.  Be cautious with removing kernels, and specify the full package and version


= systemctl assumes it works with services =
==== Replacing packages ====
systemctl, the utility used to administer services and other systemd targets, will now assume that it is working with a service. Administrators will no longer have to append '.service' to the name of the daemon they are administering. For example, `systemctl restart dhcpd` will now just work, but previous releases required `systemctl restart dhcpd.service`.
When a system requires the capabilities of a package you want to replace, use the '''--allowerasing''' option. For example, `dnf --allowerasing mariadb` will allow you to replace mysql with mariadb, without disrupting packages that require capabilities provided by both packages.  This replaces `yum shell` and `yum swap` functionality.


= Terminals get more colorful =
=== DNF reading ===
Fedora now enables supporting terminal emulators to use 256 colors. With new  environment variables, applications such as gnome-terminal, konsole, and screen will automatically be enabled with 256 color support. Other applications can display 256 colors but must be configured.


= Remote administration gets better with Agent-Free Systems Management =
* Upstream documentation at http://dnf.readthedocs.org/en/latest/index.html
On systems that contain IPMI compliant Service Processors, it is now possible to have closer integration of OS and Service Processor without the need for 3rd party software. This will enable better management of the system remotely.
* Plugins documented at https://rpm-software-management.github.io/dnf-plugins-extras/index.html

Revision as of 03:38, 12 March 2015

DocsProject Header docTeam1.png
Note.png
Beat is open
This beat is now ready to have Fedora 25 content added by the beat writer

yum replaced by dnf

The yum package manager has been replaced in Fedora 22 by its successor, dnf. The yum fork has been available in Fedora for testing since Fedora 18, and is now the default command line package manager.

Most dnf commands use directives that are familiar to yum users, and it uses the same RPM package repositories. Behind the scenes, dnf uses an improved dependency solver, hawkey, along with librepo for repository operations and libcomps for package groups.

dnf behavior

The behavior of dnf differs from yum in some areas:

Updates that don't work are skipped

If a portion of a transaction is not viable, dnf will automatically exclude it and transparently continue with the portions that will work. For example, if a package has unmet dependencies during a dnf update action, that package will not be updated, but others will. This is similar to yum's "--skip-broken" directive, but evaluates the impact of the problem against the entire transaction. Because this is the default behavior, there is no "--skip-broken" switch for dnf.

To review details about a problematic package direction, you can use the "--best" option. dnf update --best will force dnf to resolve the transaction using the latest versions of involved packages, and report any problems instead of skipping them.

Repos that don't work are skipped

If a configured and enabled repository does not respond, dnf will skip it and continue the transaction with the available repos. This differs from yum, which would immediately stop if a repository was not available.

Update and Upgrade are the same

The commands dnf update and dnf upgrade are equivalent. This differs from yum, where yum upgrade would have the same effect as yum update --obsoletes, and take obsolete packages into account.

Dependencies are not upgraded on package installation

When installing a new package, previously installed dependencies will not be upgraded. Yum offered an option for this behavior, upgrade_requirements_on_install. To upgrade with dnf, use dnf update.

Clean on remove

When removing a package, dnf will automatically remove any dependent packages that were not explicitly installed by the user. If a package was independently installed, it won't be uninstalled this way.

This behavior is configured by the "clean_requirements_on_remove" option in /etc/dnf/dnf.conf.

Repo cache refresh schedule

By default, dnf will check for updates in configured repositories hourly, starting ten minutes after the system boots. The action is controlled by a systemd timer unit, /usr/lib/systemd/system/dnf-makecache.timer.

To adjust this, copy the timer file to /etc/systemd/system/dnf-makecache.timer and edit it.

Alternatively, setting the metadata_timer_sync in /etc/dnf/dnf.conf to a number of seconds configures the minimum number of seconds between makecache operations. If the timer has not expired, dnf makecache will exit immediately.

dnf will also honor the metadata_expire option set in individual repo configs, and refresh repo metadata at runtime if it is too old. This option is described in man yum.conf.

Repository Actions =

The "repository-packages" directive can be used to search for or get info about packages in a specific repository, list installed packages frrom that repository, and more. This simplifies operations that would have required use of "--excluderepo" and "--includerepo" options with yum, and is especially useful for managing similar packages from different repositories.

Listing dependencies

To find out what package supplies a particular provide, use the dnf provides foo command. This replaces yum resolvedep foo.

To list the dependencies of a package, use dnf repoquery --requires foo. This replaces yum deplist foo.

dnf will remove kernels

kernel packages are not protected by dnf. Unlike with yum, you can remove all kernel packages, including the running package, if you direct it to. Be cautious with removing kernels, and specify the full package and version

Replacing packages

When a system requires the capabilities of a package you want to replace, use the --allowerasing option. For example, dnf --allowerasing mariadb will allow you to replace mysql with mariadb, without disrupting packages that require capabilities provided by both packages. This replaces yum shell and yum swap functionality.

DNF reading