Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
Control: tags -1 + pending Am 28.01.2026 um 22:43 schrieb Mitchell Augustin: Hello, I submitted an MR to https://salsa.debian.org/tex-team/texinfo/-/merge_requests/13 with the solution proposed in this thread. The MR has been merged. H. -- sigfault OpenPGP_signature.asc Description: OpenPGP digital signature
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
I submitted an MR to https://salsa.debian.org/tex-team/texinfo/-/merge_requests/13 with the solution proposed in this thread. On Thu, Jan 22, 2026 at 9:07 AM Mitchell Augustin wrote: > > > could you provide your /etc/environments file? > > I'm not Daniel, but if you just need a reproducer for the issue with > sourcing, a minimal repro is to add an unquoted variable with > semicolons in your /etc/environments, such as this: > root@envtest:~# cat /etc/environment > PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" > MY_LIST=1;2;3;4;5 > > and then attempt to `apt install` any program. You should then see: > dpkg: error processing package install-info (--configure): > installed install-info package post-installation script subprocess > returned error exit status 127 > > > Please let me know if there is any additional context I can provide > here to further assist you in deciding how to address this bug. > > Thanks, > Mitchell Augustin > > > On Wed, Dec 10, 2025 at 5:13 PM Mitchell Augustin > wrote: > > > > Hi all, > > > > This still seems to be an issue for some applications. Have there been > > any discussions on the Debian side about adjusting the handling of > > /etc/environment here? > > > > -- > > Mitchell Augustin > > Software Engineer - Ubuntu Partner Engineering > > Email:[email protected] > > Location:United States of America (Central Time) > > > > > > canonical.com > > ubuntu.com > > > > -- > Mitchell Augustin > Software Engineer - Ubuntu Partner Engineering > Email:[email protected] > Location:United States of America (Central Time) > > > canonical.com > ubuntu.com -- Mitchell Augustin Software Engineer - Ubuntu Partner Engineering Email:[email protected] [email protected] Location:United States of America (Central Time) canonical.com ubuntu.com
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
> could you provide your /etc/environments file? I'm not Daniel, but if you just need a reproducer for the issue with sourcing, a minimal repro is to add an unquoted variable with semicolons in your /etc/environments, such as this: root@envtest:~# cat /etc/environment PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" MY_LIST=1;2;3;4;5 and then attempt to `apt install` any program. You should then see: dpkg: error processing package install-info (--configure): installed install-info package post-installation script subprocess returned error exit status 127 Please let me know if there is any additional context I can provide here to further assist you in deciding how to address this bug. Thanks, Mitchell Augustin On Wed, Dec 10, 2025 at 5:13 PM Mitchell Augustin wrote: > > Hi all, > > This still seems to be an issue for some applications. Have there been > any discussions on the Debian side about adjusting the handling of > /etc/environment here? > > -- > Mitchell Augustin > Software Engineer - Ubuntu Partner Engineering > Email:[email protected] > Location:United States of America (Central Time) > > > canonical.com > ubuntu.com -- Mitchell Augustin Software Engineer - Ubuntu Partner Engineering Email:[email protected] Location:United States of America (Central Time) canonical.com ubuntu.com
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
Hello, could you provide your /etc/environments file? Hilmar 12.12.2025 17:41:57 Daniel Abrecht : > Package: update-info-dir > Version: 6.8-6+b1 > > > After an "apt-get upgrade", I got this output: > ``` > Reading package lists... Done > Building dependency tree... Done > Reading state information... Done > Calculating upgrade... Done > 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. > 1 not fully installed or removed. > After this operation, 0 B of additional disk space will be used. > Do you want to continue? [Y/n] > Setting up install-info (6.8-6+b1) ... > /usr/sbin/update-info-dir: 4: /etc/environment: help: not found > dpkg: error processing package install-info (--configure): > installed install-info package post-installation script subprocess returned > error exit status 127 > Errors were encountered while processing: > install-info > E: Sub-process /usr/bin/dpkg returned an error code (1) > ``` > > > The script /usr/sbin/update-info-dir sources /etc/environment, but > /etc/environment is not a shell script. > Usually, this file is loaded by pam_env, from the man page PAM_ENV(7): >> Second a file (/etc/environment by default) with simple KEY=VAL pairs on >> separate lines will be read > > Please note that /etc/environment does not contain any form of quoting or > escaping, nor can it contain comments. > Because the script /usr/sbin/update-info-dir sources /etc/environment, if any > of the values contains a space, it'll try executing part of it as a command, > which is not desirable. > > Loading this file in a script correctly can be quiet tricky. I'm not sure why > it's done here at all, but I think the following should work: > ``` > exec 9<&0 while read -r env > do if [ -n "$env" ] > then export "$env" > fi; done > exec 0<&9 9<&- > ``` > > There is one more thing to consider. Some packages seam to distribute config > files stored in /etc/environment.d/. > On my system, they do not seam to get loaded, although I'm pretty sure on > distros where pam_env is built with econf support, they usually do get loaded. > I also don't know where else /etc/environment and /etc/environment.d/ may get > loaded nowadays, it's quiet possible other scripts may have similar issues. > And I think the inconsistent use of /etc/environment.d/ in debian is a bigger > issue, a decision should be made what to do about it.
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
Am 07.09.2025 um 17:15 schrieb Daniel Abrecht: Hello, Please note that /etc/environment does not contain any form of quoting or escaping, nor can it contain comments. Because the script /usr/sbin/update-info-dir sources /etc/environment, if any of the values contains a space, it'll try executing part of it as a command, which is not desirable. Loading this file in a script correctly can be quiet tricky. I'm not sure why it's done here at all, but I think the following should work: ``` You may have a look at [1], when looking for the reason, why we source /etc/environment at all. Thanks for the code suggestion, I'll have a look at it. Hilmar [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=536476 -- sigfault OpenPGP_signature.asc Description: OpenPGP digital signature
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
Control: severity -1 important Am 11.12.2025 um 00:13 schrieb Mitchell Augustin: Hello, This still seems to be an issue for some applications. Have there been any discussions on the Debian side about adjusting the handling of /etc/environment here? Due to the wrongly named package the original submission did not reach me. And the reassignment I probably ignored, assuming that I have already the submission. I'll try to have a look. H. -- sigfault OpenPGP_signature.asc Description: OpenPGP digital signature
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
Hi all, This still seems to be an issue for some applications. Have there been any discussions on the Debian side about adjusting the handling of /etc/environment here? -- Mitchell Augustin Software Engineer - Ubuntu Partner Engineering Email:[email protected] Location:United States of America (Central Time) canonical.com ubuntu.com
Bug#1114610: post-installation script failed due to incorrect processing of /etc/environment
Package: update-info-dir Version: 6.8-6+b1 After an "apt-get upgrade", I got this output: ``` Reading package lists... Done Building dependency tree... Done Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Setting up install-info (6.8-6+b1) ... /usr/sbin/update-info-dir: 4: /etc/environment: help: not found dpkg: error processing package install-info (--configure): installed install-info package post-installation script subprocess returned error exit status 127 Errors were encountered while processing: install-info E: Sub-process /usr/bin/dpkg returned an error code (1) ``` The script /usr/sbin/update-info-dir sources /etc/environment, but /etc/environment is not a shell script. Usually, this file is loaded by pam_env, from the man page PAM_ENV(7): Second a file (/etc/environment by default) with simple KEY=VAL pairs on separate lines will be read Please note that /etc/environment does not contain any form of quoting or escaping, nor can it contain comments. Because the script /usr/sbin/update-info-dir sources /etc/environment, if any of the values contains a space, it'll try executing part of it as a command, which is not desirable. Loading this file in a script correctly can be quiet tricky. I'm not sure why it's done here at all, but I think the following should work: ``` exec 9<&0 There is one more thing to consider. Some packages seam to distribute config files stored in /etc/environment.d/. On my system, they do not seam to get loaded, although I'm pretty sure on distros where pam_env is built with econf support, they usually do get loaded. I also don't know where else /etc/environment and /etc/environment.d/ may get loaded nowadays, it's quiet possible other scripts may have similar issues. And I think the inconsistent use of /etc/environment.d/ in debian is a bigger issue, a decision should be made what to do about it.

