From bdb6ae69b375789a81dca5c4aa62a65ff668238a Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sun, 15 Feb 2026 11:16:27 +0000 Subject: [PATCH] apt-get install: Add --fix-broken to commandline apt-get install suggests it wants to be called with -f to clean up some mess left behind from a previous install. Adding -f in the hope add it to the install options by default. OTOH, it wants to be called that without arguments, not sure if always passing it along is a good idea. The man page says: -f, --fix-broken Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are specified, these have to completely correct the problem. The option is sometimes necessary when running APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is possible that a system's dependency structure can be so corrupt as to require manual intervention (which usually means using dpkg --remove to eliminate some of the offending packages). Use of this option together with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken. Also turn the short options -yq into long options --yes --quiet for more obvious debugging if something goes awry. Signed-off-by: Jan Lindemann --- src/python/jw/pkg/cmds/distro/backend/debian/Base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/jw/pkg/cmds/distro/backend/debian/Base.py b/src/python/jw/pkg/cmds/distro/backend/debian/Base.py index ff4105a3..5edb92f5 100644 --- a/src/python/jw/pkg/cmds/distro/backend/debian/Base.py +++ b/src/python/jw/pkg/cmds/distro/backend/debian/Base.py @@ -12,7 +12,7 @@ class Base(BackendCmd): cmd = ['/usr/bin/apt-get'] mod_env = None if not self.interactive: - cmd.extend(['-yq']) + cmd.extend(['-yes', '--quiet', '--fix-broken']) mod_env = { 'DEBIAN_FRONTEND': 'noninteractive' } cmd.extend(args) return await self._sudo(cmd, mod_env=mod_env)