0

I needed to get a bug fix which arrived in Python 2.7.3

Latest version available for 11.10 was 2.7.2, so I built Python 2.7.3 from source

Now when I try to apt-get [anything] I get this error at the end:

Setting up unattended-upgrades (0.73ubuntu1) ...
update-rc.d: warning: unattended-upgrades start runlevel arguments (2 3 4 5) do not match LSB Default-Start values (none)
update-rc.d: warning: unattended-upgrades stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (0 6)
Checking for running unattended-upgrades: 
Traceback (most recent call last):
  File "/usr/share/unattended-upgrades/unattended-upgrade-shutdown", line 27, in <module>
    import apt_pkg
ImportError: No module named apt_pkg
invoke-rc.d: initscript unattended-upgrades, action "start" failed.
dpkg: error processing unattended-upgrades (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 unattended-upgrades
E: Sub-process /usr/bin/dpkg returned an error code (1)

Since this error is python related I assume I have broken some part of apt by installing a new python.

Although I installed to /usr/local/bin and haven't touched the /usr/bin/python, which is still the 2.7.2 version that came with Ubuntu.

Very grateful if someone can suggest a way out of the mess I'm now in, preferrably without reinstalling the OS.

1 Answer 1

0

By default the PATH will be set /usr/local/bin before /usr/bin which would cause this issue. A simple solution is to rename the /usr/local/bin/python executable to /usr/local/bin/python2.7.3 or something similar. Then to use this new name in situations where you need the new version.

1
  • this is indeed the answer I found
    – Anentropic
    Aug 9, 2012 at 14:30

You must log in to answer this question.

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