I have a script that automatically installs packages. It is triggered by a systemd timer. On Ubuntu I can check if a reboot is required by looking for /var/run/reboot-required. According to https://serverfault.com/q/122178 , I can check if a reboot is required using 'needs-restarting'. 'needs-restarting' is part of the yum-utils package. needs-restarting produces the following when run from the command line: $ sudo needs-restarting Yum-utils package has been deprecated, use dnf instead. See 'man yum2dnf' for more information. I have not been able to locate the equivalent command using dnf. I took a look at /usr/bin/needs-restarting, but it looks like it is doing more than a simple dnf command. ----- $ dnf info needs-restarting Last metadata expiration check: 0:53:18 ago on Mon 17 Jun 2019 05:08:01 PM EDT. Error: No matching Packages to list $ dnf info yum-utils Last metadata expiration check: 0:53:32 ago on Mon 17 Jun 2019 05:08:01 PM EDT. Installed Packages Name : yum-utils Version : 1.1.31 Release : 518.fc29 Architecture : noarch Size : 335 k Source : yum-utils-1.1.31-518.fc29.src.rpm Repository : @System From repo : updates Summary : Utilities based around the yum package manager ...
I did not make this part of the original report, but trying to run dnf-utils goes sideways: $ sudo dnf install dnf-utils Fedora Modular 29 - x86_64 121 kB/s | 18 kB 00:00 Fedora Modular 29 - x86_64 - Updates 118 kB/s | 18 kB 00:00 Fedora 29 - x86_64 - Updates 56 kB/s | 19 kB 00:00 Fedora 29 - x86_64 54 kB/s | 19 kB 00:00 Dependencies resolved. Problem: problem with installed package yum-utils-1.1.31-518.fc29.noarch - package dnf-utils-4.0.7-1.fc29.noarch conflicts with yum-utils < 1.1.31-530 provided by yum-utils-1.1.31-518.fc29.noarch - package dnf-utils-4.0.7-1.fc29.noarch conflicts with yum-utils < 1.1.31-530 provided by yum-utils-1.1.31-517.fc29.noarch - cannot install the best candidate for the job ================================================================================ Package Arch Version Repo Size ================================================================================ Installing: dnf-utils noarch 4.0.0-2.fc29 fedora 33 k Installing dependencies: python3-iniparse noarch 0.4-32.fc29 fedora 43 k Downgrading: dnf noarch 4.0.4-1.fc29 fedora 369 k dnf-data noarch 4.0.4-1.fc29 fedora 61 k dnf-plugins-core noarch 4.0.0-2.fc29 fedora 28 k dnf-yum noarch 4.0.4-1.fc29 fedora 56 k libdnf x86_64 0.22.0-6.fc29 fedora 523 k libsolv x86_64 0.6.35-3.fc29 fedora 361 k python3-dnf noarch 4.0.4-1.fc29 fedora 415 k python3-dnf-plugin-system-upgrade noarch 3.0.2-1.fc29 fedora 26 k python3-dnf-plugins-core noarch 4.0.0-2.fc29 fedora 136 k python3-dnf-plugins-extras-common noarch 3.0.2-1.fc29 fedora 59 k python3-hawkey x86_64 0.22.0-6.fc29 fedora 77 k python3-libdnf x86_64 0.22.0-6.fc29 fedora 578 k rpm-ostree-libs x86_64 2018.8-1.fc29 fedora 164 k Skipping packages with conflicts: (add '--best --allowerasing' to command line to force their upgrade): dnf-utils noarch 4.0.7-1.fc29 updates 33 k yum-utils noarch 1.1.31-517.fc29 fedora 110 k Transaction Summary ================================================================================ Install 2 Packages Downgrade 13 Packages Skip 2 Packages Total download size: 2.9 M Is this ok [y/N]: Y Downloading Packages: (1/15): dnf-plugins-core-4.0.0-2.fc29.noarch.rp 136 kB/s | 28 kB 00:00 (2/15): dnf-data-4.0.4-1.fc29.noarch.rpm 263 kB/s | 61 kB 00:00 (3/15): dnf-yum-4.0.4-1.fc29.noarch.rpm 897 kB/s | 56 kB 00:00 (4/15): dnf-4.0.4-1.fc29.noarch.rpm 1.0 MB/s | 369 kB 00:00 (5/15): libdnf-0.22.0-6.fc29.x86_64.rpm 3.3 MB/s | 523 kB 00:00 (6/15): python3-dnf-plugin-system-upgrade-3.0.2 562 kB/s | 26 kB 00:00 (7/15): python3-dnf-4.0.4-1.fc29.noarch.rpm 4.1 MB/s | 415 kB 00:00 (8/15): python3-dnf-plugins-core-4.0.0-2.fc29.n 2.8 MB/s | 136 kB 00:00 (9/15): libsolv-0.6.35-3.fc29.x86_64.rpm 1.6 MB/s | 361 kB 00:00 (10/15): python3-dnf-plugins-extras-common-3.0. 1.2 MB/s | 59 kB 00:00 (11/15): python3-hawkey-0.22.0-6.fc29.x86_64.rp 2.5 MB/s | 77 kB 00:00 (12/15): rpm-ostree-libs-2018.8-1.fc29.x86_64.r 2.6 MB/s | 164 kB 00:00 (13/15): dnf-utils-4.0.0-2.fc29.noarch.rpm 458 kB/s | 33 kB 00:00 (14/15): python3-iniparse-0.4-32.fc29.noarch.rp 777 kB/s | 43 kB 00:00 (15/15): python3-libdnf-0.22.0-6.fc29.x86_64.rp 1.9 MB/s | 578 kB 00:00 -------------------------------------------------------------------------------- Total 2.9 MB/s | 2.9 MB 00:00 Running transaction check Transaction check succeeded. Running transaction test The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: Transaction check error: file /usr/bin/debuginfo-install from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/find-repos-of-install from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/package-cleanup from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/repo-graph from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/repoclosure from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/repomanage from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/repoquery from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/reposync from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/repotrack from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/yum-builddep from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/yum-config-manager from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/yum-debug-dump from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/yum-debug-restore from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/bin/yumdownloader from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/debuginfo-install.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/find-repos-of-install.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/needs-restarting.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/package-cleanup.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/repo-graph.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/repoclosure.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/repomanage.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/repoquery.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/reposync.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/repotrack.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/yum-builddep.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/yum-config-manager.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/yum-debug-dump.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/yum-debug-restore.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/yum-utils.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch file /usr/share/man/man1/yumdownloader.1.gz from install of dnf-utils-4.0.0-2.fc29.noarch conflicts with file from package yum-utils-1.1.31-518.fc29.noarch
The needs-restarting utility is now available in Fedora. The other issue described in Comment 1 is already tracked here (and most likely going to be closed anyway): https://bugzilla.redhat.com/show_bug.cgi?id=1680221 That said, closing this one.