Skip to content

Commit

Permalink
Replace yum with dnf for package installation
Browse files Browse the repository at this point in the history
Since we now only support latest 2 releases of RHEL/Centos/Fedora and
all distro now have dnf as default installed. We only needed yum for
RHEL-7 which is now not supported as per our support matrics.
  • Loading branch information
praveenkumar authored and anjannath committed Dec 13, 2022
1 parent 3806625 commit d36d035
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions docs/source/topics/ref_required-software-packages.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Consult the following table to find the command used to install these packages f
[options="header"]
|====
|Linux Distribution|Installation command
|{fed}|`sudo dnf install NetworkManager`
|{rhel}/{centos}|`su -c 'yum install NetworkManager'`
|{fed}/{rhel}/{centos}|`sudo dnf install NetworkManager`
|{debian}/{ubuntu}|`sudo apt install qemu-kvm libvirt-daemon libvirt-daemon-system network-manager`
|====
8 changes: 4 additions & 4 deletions pkg/crc/preflight/preflight_checks_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@ func fixLibvirtInstalled(distro *linux.OsRelease) func() error {
}

func installLibvirtCommand(distro *linux.OsRelease) string {
yumCommand := "yum install -y libvirt libvirt-daemon-kvm qemu-kvm"
dnfCommand := "dnf install -y libvirt libvirt-daemon-kvm qemu-kvm"
switch {
case distroIsLike(distro, linux.Ubuntu):
return "apt-get update && apt-get install -y libvirt-daemon libvirt-daemon-system libvirt-clients"
case distroIsLike(distro, linux.Fedora):
return yumCommand
return dnfCommand
default:
logging.Warnf("unsupported distribution %s, trying to install libvirt with yum", distro)
return yumCommand
logging.Warnf("unsupported distribution %s, trying to install libvirt with dnf", distro)
return dnfCommand
}
}

Expand Down

0 comments on commit d36d035

Please sign in to comment.