diff --git a/src/steps/os/linux.rs b/src/steps/os/linux.rs index 66ebdb6e..83b95076 100644 --- a/src/steps/os/linux.rs +++ b/src/steps/os/linux.rs @@ -227,14 +227,24 @@ fn upgrade_arch_linux(ctx: &ExecutionContext) -> Result<()> { } fn upgrade_redhat(ctx: &ExecutionContext) -> Result<()> { + if let Some(ostree) = Path::new("/usr/bin/rpm-ostree").if_exists() { + let mut command = ctx.run_type().execute(ostree); + command.arg("upgrade"); + if ctx.config().yes() { + command.arg("-y"); + } + + return command.check_run(); + } + 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( + Path::new("/usr/bin/dnf") .if_exists() - .unwrap_or_else(|| Path::new("/usr/bin/rpm-ostree")) - })) + .unwrap_or_else(|| Path::new("/usr/bin/yum")), + ) .arg("upgrade"); if let Some(args) = ctx.config().dnf_arguments() {