After a recent apt-get upgrade on 16.04 I now always get errors from install-info:

$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 1 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up install-info (6.1.0.dfsg.1-5) ...
/usr/sbin/update-info-dir: 23: /etc/environment: /usr/local/lib/python2.7/dist-packages: Permission denied
dpkg: error processing package install-info (--configure):
 subprocess installed post-installation script returned error exit status 126
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ ls -ld /etc/environment /usr/local/lib/python2.7/dist-packages
-rw-r--r--   1 root root  1181 Sep 14 21:08 /etc/environment
drwxrwsr-x 331 root root 20480 Sep 14 15:15 /usr/local/lib/python2.7/dist-packages

EDIT: The one line I've changed [added] this month in my /etc/environment was:

  • what is in your /etc/environment file? You can edit your question to add information
    – Zanna
    Sep 19 '16 at 6:57
  • @Zanna: My /etc/environment is 24 lines, so I've just edited the question with my change.
    – A T
    Sep 19 '16 at 6:59
  • I think you need to change the semicolon there to a colon, correction here: PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local/lib/python2.7/dist-packages log out and in again and see if it's fixed
    – Zanna
    Sep 19 '16 at 7:04
  • Oh whoops I think that's it >.<; clearly too much switching between *nix and Windows!
    – A T
    Sep 19 '16 at 7:04
  • heh what shall we do here? You want to answer your own question?
    – Zanna
    Sep 19 '16 at 7:05

Items in a PATH variable should be separated with colons

$ echo $PATH

If you use a semicolon instead, bash interprets the thing after the semicolon as a command

$ export PATH=$PATH;/home/zanna/playground
bash: /home/zanna/playground: Is a directory

A clearer illustration: I added a script that just contains uname -r:

$ export PATH=$PATH;/home/zanna/playground/uname

To fix your problem, change this line in /etc/environment




And log out and back in :)

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.