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..

Zanna
  • 70,465
  • 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. – Tom Connolly May 11 '18 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 '18 at 07:48
  • See also https://askubuntu.com/questions/1069702/dpkg-error-processing-package-install-info – robo8920 Oct 25 '22 at 12:35

2 Answers2

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

Zanna
  • 70,465
  • Another option is to edit the offending .postinst file and put exit 0 on the second line (after the first line containing #!/bin/sh. – WinEunuuchs2Unix May 12 '18 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

Zanna
  • 70,465