From c694ea2cbca91ac4fe126b99e7c9474bc1c03ba2 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 4 Jul 2024 19:27:51 +0200 Subject: [PATCH] bullseye->bookworm: force-regen the nsswitch configuration because for some reason it gets reset? --- src/migrations/0027_migrate_to_bookworm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/migrations/0027_migrate_to_bookworm.py b/src/migrations/0027_migrate_to_bookworm.py index e3d6007c6..898c4e347 100644 --- a/src/migrations/0027_migrate_to_bookworm.py +++ b/src/migrations/0027_migrate_to_bookworm.py @@ -12,7 +12,7 @@ from yunohost.tools import ( tools_update, ) from yunohost.app import unstable_apps -from yunohost.regenconf import manually_modified_files +from yunohost.regenconf import manually_modified_files, regen_conf from yunohost.utils.system import ( free_space_in_directory, get_ynh_package_version, @@ -181,6 +181,11 @@ class MyMigration(Migration): # FIXME : find a way to simulate and validate the upgrade first aptitude_with_progress_bar("full-upgrade --show-why -y -o Dpkg::Options::='--force-confold'") + # Force regenconf of nsswitch because for some reason + # /etc/nsswitch.conf is reset despite the --force-confold? It's a + # disaster because then admins cannot "sudo" >_> ... + regen_conf(names=["nsswitch"], force=True) + if self.debian_major_version() == N_CURRENT_DEBIAN: raise YunohostError("migration_0027_still_on_bullseye_after_main_upgrade")