diff --git a/actions/upgrades b/actions/upgrades index 929221bdf..0cf16586a 100755 --- a/actions/upgrades +++ b/actions/upgrades @@ -425,8 +425,10 @@ def _perform_dist_upgrade(): 'Holding packages with conffile prompts: ' + ', '.join(packages_with_prompts) + '...', flush=True) with apt_hold(packages_with_prompts): - print('Running apt full-upgrade...', flush=True) - run_apt_command(['full-upgrade']) + print('Holding tt-rss package if available...', flush=True) + with apt_hold(['tt-rss'], ignore_errors=True): + print('Running apt full-upgrade...', flush=True) + run_apt_command(['full-upgrade']) # If searx is installed, update search engines list. if pathlib.Path('/etc/searx/settings.yml').exists(): diff --git a/plinth/action_utils.py b/plinth/action_utils.py index 68723f518..676c3fafb 100644 --- a/plinth/action_utils.py +++ b/plinth/action_utils.py @@ -413,7 +413,7 @@ def run_apt_command(arguments): @contextmanager -def apt_hold(packages=None): +def apt_hold(packages=None, ignore_errors=False): """Prevent packages from being removed during apt operations.""" if not packages: packages = ['freedombox'] @@ -421,7 +421,8 @@ def apt_hold(packages=None): current_hold = subprocess.check_output(['apt-mark', 'showhold'] + packages) try: yield current_hold or subprocess.run(['apt-mark', 'hold'] + packages, - check=True) + check=not ignore_errors) finally: if not current_hold: - subprocess.run(['apt-mark', 'unhold'] + packages, check=True) + subprocess.run(['apt-mark', 'unhold'] + packages, + check=not ignore_errors)