#1068435 reportbug: sudo should not reset the DEBIAN_FRONTEND env variable

Package:
sudo
Source:
sudo
Description:
Provide limited super user privileges to specific users
Submitter:
sohom
Date:
2026-05-16 12:43:02 UTC
Severity:
normal
Tags:
#1068435#5
Date:
2024-04-05 06:34:52 UTC
From:
To:
Dear Maintainer,

I use a debian docker container to build Chromium. As of late, the build
process has been failing due to the fact that certain new dependencies
require user interaction to resolve (selecting keyboard and languages
etc). This shows up despite setting the recommended
`DEBIAN_FRONTEND=noninteractive` env variable and using the
recommended `--no-prompt` flag provided the `./build/install-build-deps.sh`
script provided by Chromium.

Based on my understanding, the problem here is caused by the fact that
sudo by default will reject and reset all env variables before running
apt (Chromium's script effectively runs `sudo apt install -y <packages>`).

Given this, itt would be great if `DEBIAN_FRONTEND` could be added to sudo's env
whitelist for debian so that it could be passed to apt.

P.S: I apologize if the configurations attached to this report are
non-standard, I am reporting this bug from inside the aforementioned
docker container.

#1068435#10
Date:
2024-09-22 19:16:18 UTC
From:
To:
Control: found -1 1.9.15p5-3
thanks

I understand the issue, but I am not sure whether we should really add
one-by-one environment variable to the default configuration. What do
other people think about that? I would like to hear more opinions before
the change is made.

Greetings
Marc

#1068435#15
Date:
2024-09-22 19:16:18 UTC
From:
To:
Control: found -1 1.9.15p5-3
thanks

I understand the issue, but I am not sure whether we should really add
one-by-one environment variable to the default configuration. What do
other people think about that? I would like to hear more opinions before
the change is made.

Greetings
Marc

#1068435#20
Date:
2024-09-23 06:01:33 UTC
From:
To:
I was gonna say that I doubt sudo should allow a wide list of
environment variables by default, until I saw the output of sudo -V
(as root).

Given the existing lists there, one would at least have to classify
any new environment variable into one of the existing groups.
ISTM variables that effectively change the behaviour of programs,
apart from (hopefully) inconsequential display differences (color,
language), should however go into the default list of env vars to
*remove*, not to *preserve*.

Chris

#1068435#23
Date:
2024-09-23 06:01:33 UTC
From:
To:
I was gonna say that I doubt sudo should allow a wide list of
environment variables by default, until I saw the output of sudo -V
(as root).

Given the existing lists there, one would at least have to classify
any new environment variable into one of the existing groups.
ISTM variables that effectively change the behaviour of programs,
apart from (hopefully) inconsequential display differences (color,
language), should however go into the default list of env vars to
*remove*, not to *preserve*.

Chris

#1068435#28
Date:
2024-09-23 06:09:07 UTC
From:
To:
Those lists are mainly by upstream. I am not aware of any
Debian-specific changes in this part of the upstream sources, and our
default /etc/sudoers don't have anything active regarding environment
variables.

Greetings
Marc

#1068435#31
Date:
2024-09-23 06:09:07 UTC
From:
To:
Those lists are mainly by upstream. I am not aware of any
Debian-specific changes in this part of the upstream sources, and our
default /etc/sudoers don't have anything active regarding environment
variables.

Greetings
Marc

#1068435#36
Date:
2026-02-10 18:49:30 UTC
From:
To:
Control: tags -1 wontfix
Control: retitle -1 sudo should not reset my favorite the DEBIAN_FRONTEND env variable (originally: DEBIAN_FRONTEND)
thanks

As thre hasnt been much discussion about this, I am wontfixing this with
the suggestion to drop a /etc/sudoers.d file containing your local list
of environment variables to be preserved

Greetings
Marc

#1068435#45
Date:
2026-05-16 12:41:33 UTC
From:
To:
The new /etc/sudoers has a row of commented out suggestions regarding
env_reset settings, I have added DEBIAN_FRONTEND to the list of
Debian-relate environment variables

Greetings
Marc

#1068435#48
Date:
2026-05-16 12:41:33 UTC
From:
To:
The new /etc/sudoers has a row of commented out suggestions regarding
env_reset settings, I have added DEBIAN_FRONTEND to the list of
Debian-relate environment variables

Greetings
Marc