2

This is the error message I get when I do a sudo apt upgrade. The upgrade fails and includes this message:

Setting up install-info (6.1.0.dfsg.1-5) ...
/usr/sbin/update-info-dir: 2: /etc/environment: source: not found
dpkg: error processing package install-info (--configure):
subprocess installed post-installation script returned error exit 
status 127
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

I reinstalled install-info through synaptic and am still getting this error and would be grateful for help in setting me straight as to how to read this message and how to react..

3
  • Can someone help me to read this error message? It seems to be saying /etc/environment is missing something? It's simply a line of path statements. May 11, 2018 at 19:06
  • Looking at the error, it seems there is a command in the script /usr/sbin/update-info-dir that says source /etc/environment, but it is being run by a shell (dash I guess) that doesn't know the source command. Instead of source, that script should have . /etc/environment, which does the same thing. That's very very strange. Here's the version of that file I have on my system
    – Zanna
    May 16, 2018 at 7:48
  • See also askubuntu.com/questions/1069702/…
    – robo8920
    Oct 25, 2022 at 12:35

2 Answers 2

1

I found this way down in a thread elsewhere, and it worked!

if all else fails. What I did was I first changed the directory to:

cd /var/lib/dpkg/info

then I removed everything with .postinst:

sudo rm *.postinst

then update repositories

sudo apt-get update

then everything went back to normal when I did:

sudo apt-get --force-yes install openjdk-7-jre-headless

Note: I did not do this last line, as my issue didn't have anything to do with openjdk. I simply ran the apt update

1
  • Another option is to edit the offending .postinst file and put exit 0 on the second line (after the first line containing #!/bin/sh. May 12, 2018 at 18:21
0

I started to get same thing and just used

for i in $(ls -F *.postinst); do mv ./$i ./$i.old; done in /var/lib/dpkg/info

then my standard ansible playbooks to bring servers current worked

1
  • those files will have standard names, but in general, you shouldn't parse the output of ls and more importantly, you shouldn't post answers with commands with no explanation of what they do! Please edit this to add some commentary
    – Zanna
    May 16, 2018 at 7:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .