From 71690e2c1890922db4c0d719863f65f8bfeb1743 Mon Sep 17 00:00:00 2001 From: Josh Rendek Date: Sat, 7 Oct 2023 22:46:14 -0400 Subject: [PATCH] Fix CentOS 7 support and install dnf --- operating_system.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/operating_system.go b/operating_system.go index 999afc8..606e697 100644 --- a/operating_system.go +++ b/operating_system.go @@ -80,6 +80,14 @@ func checkPreReqs() { } } else if agent.linux == "centos" { + if !fileReader.FileExists("/usr/bin/dnf") { + fmt.Println("dnf not found, installing") + out, err := runner.Run("yum", "install", "-y", "dnf") + if err != nil { + panic(err) + } + logging.LogMsg(out) + } if !fileReader.FileExists("/usr/bin/needs-restarting") { fmt.Println("needs-restarting not found, installing")