diff --git a/subiquity/server/apt.py b/subiquity/server/apt.py index a7db4fc0..402fb410 100644 --- a/subiquity/server/apt.py +++ b/subiquity/server/apt.py @@ -173,7 +173,10 @@ class AptConfigurer: apt_cmd.append( f"-o{target}::DefaultEnabled=false") - proc = await astart_command(apt_cmd, stderr=subprocess.STDOUT) + env = os.environ.copy() + env["LANG"] = self.app.base_model.locale.selected_language + proc = await astart_command(apt_cmd, stderr=subprocess.STDOUT, + clean_locale=False, env=env) async def _reader(): while not proc.stdout.at_eof(): diff --git a/subiquity/server/tests/test_apt.py b/subiquity/server/tests/test_apt.py index 20e86f4b..e84dc2b2 100644 --- a/subiquity/server/tests/test_apt.py +++ b/subiquity/server/tests/test_apt.py @@ -60,6 +60,7 @@ class TestAptConfigurer(SubiTestCase): self.model = Mock() self.model.mirror = MirrorModel() self.model.proxy = ProxyModel() + self.model.locale.selected_language = "en_US.UTF-8" self.app = make_app(self.model) self.configurer = AptConfigurer(self.app, AsyncMock(), '')