5

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:
 install-info
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:

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

1 Answer 1

4

Items in a PATH variable should be separated with colons

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/telegram:/opt/lks-indicator:/snap/bin

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
4.4.0-36-generic

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

PYTHONPATH=/usr/local/lib/python2.7/site-packages;/usr/local‌​/lib/python2.7/dist-‌​packages

to

PYTHONPATH=/usr/local/lib/python2.7/site-packages:/usr/local‌​/lib/python2.7/dist-‌​packages

And log out and back in :)

You must log in to answer this question.

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