From 412b959870ca864443667d8edd0fa76ef4a126fa Mon Sep 17 00:00:00 2001 From: Kevin Kofler Date: Mon, 19 Jan 2015 02:57:29 +0100 Subject: [PATCH] packages: Offline package removal for yum and dnf. When removing packages with yum or dnf, pass the --disablerepo=* (disable all online repositories) and -C (run from cache) arguments. Package removals do not normally require network access, and this measure saves time and bandwidth and prevents possible unnecessary errors (e.g., if we do not have active network access, or if there is some problem with the mirrors). --- src/modules/packages/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 1b68ec294..709930ccc 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -48,9 +48,9 @@ class PackageManager: elif self.backend == "zypp": check_chroot_call(["zypper", "--non-interactive", "remove"] + pkgs) elif self.backend == "yum": - check_chroot_call(["yum", "-y", "remove"] + pkgs) + check_chroot_call(["yum", "--disablerepo=*", "-C", "-y", "remove"] + pkgs) elif self.backend == "dnf": - check_chroot_call(["dnf", "-y", "remove"] + pkgs) + check_chroot_call(["dnf", "--disablerepo=*", "-C", "-y", "remove"] + pkgs) elif self.backend == "urpmi": check_chroot_call(["urpme"] + pkgs) elif self.backend == "apt":