I tried installing imagemagick package by sudo apt-get install imagemagick

I'm getting the following error now, how to fix it.

$ sudo apt-get install imagemagick
Reading package lists... Done
Building dependency tree       
Reading state information... Done
imagemagick is already the newest version (8:
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] y
Setting up install-info (6.4.90.dfsg.1-1build1) ...
/usr/sbin/update-info-dir: 2: /etc/environment: TESSDATA_PREFIX: not found
dpkg: error processing package install-info (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • 1
    Please add contents of /etc/environment file to the question. – N0rbert Aug 28 '18 at 11:30
  • 1
    i found somewhere the answer, its fixed - i have posted the answer. – Shan Khan Aug 28 '18 at 12:27
sudo mv /var/lib/dpkg/info/install-info.postinst /var/lib/dpkg/info/install-info.postinst.bad

Fixed the problem.

  • Thanks this helps solved my problem when i tried to install mdadm – nuttynibbles Jun 4 at 7:34
  • Yep. This solve the problem. Thanks. – Luís Assunção Jun 5 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.