Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When trying to upgrade my release from 12.10 to 13.04 I get this output in terminal:

axept@aXept-Lifebook:~$ sudo do-release-upgrade
Ser etter ny utgave av Ubuntu
Traceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 144, in <module>
    fetcher = get_fetcher(options.frontend, m.new_dist, options.data_dir)
  File "/usr/bin/do-release-upgrade", line 37, in get_fetcher
    from DistUpgrade.DistUpgradeFetcherCore import DistUpgradeFetcherCore
  File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcherCore.py",       line  30, in <module>
   import tempfile
EOFError: EOF read where not expected
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 64, in              apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 4, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in <module>
import subprocess, tempfile, os.path, re, pwd, grp, os
EOFError: EOF read where not expected

Original exception was:
Traceback (most recent call last):
 File "/usr/bin/do-release-upgrade", line 144, in <module>
 fetcher = get_fetcher(options.frontend, m.new_dist, options.data_dir)
 File "/usr/bin/do-release-upgrade", line 37, in get_fetcher
 from DistUpgrade.DistUpgradeFetcherCore import DistUpgradeFetcherCore
 File "/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeFetcherCore.py", line      30, in <module>
 import tempfile
EOFError: EOF read where not expected
axept@aXept-Lifebook:~$

And when running apt-cache info:

axept@aXept-Lifebook:~$ apt-cache policy ubuntu-release-upgrader-core
ubuntu-release-upgrader-core:
Installert: 1:0.190.7
Kandidat:   1:0.190.7
Versjonstabell:
*** 1:0.190.7 0
    500 http://no.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 Packages
    500 http://gb.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 Packages
    500 http://security.ubuntu.com/ubuntu/ quantal-security/main amd64 Packages
    100 /var/lib/dpkg/status
 1:0.190.1 0
    500 http://no.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages

And:

sudo apt-get update && sudo apt-get upgrade

Don't do anything. All is up to date apparently..

Trying to launch "Update Manager" gives the same error as "do-release-upgrade". Tried to remove .pyc files in /etc/apt/dist-packages/ and reinstalled python stuff as found in a Bug-report...

Any suggestion?

This install is NOT new, my laptop has been running fine for months without problems.

Btw, running "Software packages" from "system-settings" doesn't work. It won't start. Suppose its the same reason.. Its been slow to start before, but now it just won't start.

UPDATE: Get the same error when trying to add a repository from terminal.. Whats going on??????

UPDATE 2: When "Update Manager" launch automatic with new system updates, it doesn't work. Nothing happens when I click "Install now" button..

share|improve this question
    
btw, that "gb" lines in sources.list was just to test another one.. Was the same before they was added.. –  aXept Jul 3 '13 at 21:50
    
It appears that you have a bad python version installed, did you recently install a new version of python? –  coteyr Jul 9 '13 at 21:05
    
Not that I know.. Must be a update then? Have not installed anything new lately.. How to remove and reinstall python? –  aXept Jul 9 '13 at 21:06
    
The core of it seems to be a corrupt .pyc file. Can you do apt-get dist-upgrade. dist-upgrade should work fine, and might replace the croupted files in the process. –  coteyr Jul 9 '13 at 21:09
    
Seems to work..Its installing somethings now, for a change :P I'll get back to you :) -- I know, its installing some kernels.. –  aXept Jul 9 '13 at 21:13

2 Answers 2

up vote 0 down vote accepted

This is not a running problem anymore.

Re-installed a fresh install of 13.04. Didn't find any other solution.

share|improve this answer

For anyone landing here without the option to reinstall a fresh system, this is what helped me:

I got the same problem after upgrading from 12.04 to 12.10. The upgrade introduces python 3.2 as the default python interpreter.

As discussed here the problem is corrupted .pyc files. Reinstalling python3-distupgrade as suggested did not have any effect for me.

Tl;dr: I ended up needing to reinstall python3 and python3-minimal followed by manually removing all __pycache__ folders in /usr/lib/python3/dist-packages:

sudo apt-get install --reinstall python3 python3-minimal
sudo find /usr/lib/python3/dist-packages -name '__pycache__' -type d -exec rm -rf '{}' \;

Caution: The second command is potentially dangerous if mistyped.

share|improve this answer
    
Ahh, too late for me :( Mine install of 12.10 was not a upgrade from 12.04 and for some reason it was python2.7 that was being used by the system. There was installed python3.2 as well. I tried to change, didn't work. Too bad I didn't try your solution.. –  aXept Jul 14 '13 at 18:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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