From 76ae636f202e5e2386d1e96235e99b6bbbc510f3 Mon Sep 17 00:00:00 2001 From: Roey Darwish Dror Date: Mon, 7 Dec 2020 20:41:29 +0200 Subject: [PATCH] Use distro-sync in dnf (fix #576) (#579) --- src/steps/os/linux.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index ff53be91..5c1e23cd 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -243,13 +243,11 @@ fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> { if let Some(sudo) = &ctx.sudo() { let mut command = ctx.run_type().execute(&sudo); - command - .arg( - Path::new("/usr/bin/dnf") - .if_exists() - .unwrap_or_else(|| Path::new("/usr/bin/yum")), - ) - .arg("upgrade"); + if let Some(dnf) = Path::new("/usr/bin/dnf").if_exists() { + command.arg(dnf).arg("distro-sync"); + } else { + command.args(&["/usr/bin/yum", "upgrade"]); + } if let Some(args) = ctx.config().dnf_arguments() { command.args(args.split_whitespace());