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.

I have just tried to upgrade to 13.10 from 13.04 and I have received the following error in console

Checking for a new Ubuntu release
authenticate 'saucy.tar.gz' against 'saucy.tar.gz.gpg' 
extracting 'saucy.tar.gz'
Traceback (most recent call last):
  File "/tmp/user/0/ubuntu-release-upgrader-xnzjbd/saucy", line 10, in <module>
    sys.exit(main())
  File "/tmp/user/0/ubuntu-release-upgrader-xnzjbd/DistUpgrade/DistUpgradeMain.py", line 240, in main
    save_system_state(logdir)
  File "/tmp/user/0/ubuntu-release-upgrader-xnzjbd/DistUpgrade/DistUpgradeMain.py", line 133, in save_system_state
    scrub_sources=True)
  File "/tmp/user/0/ubuntu-release-upgrader-xnzjbd/DistUpgrade/apt_clone.py", line 149, in save_state
    self._write_state_sources_list(tar, scrub_sources)
  File "/tmp/user/0/ubuntu-release-upgrader-xnzjbd/DistUpgrade/apt_clone.py", line 241, in _write_state_sources_list
    "./etc/apt/sources.list.d/"+source)
  File "/tmp/user/0/ubuntu-release-upgrader-xnzjbd/DistUpgrade/apt_clone.py", line 246, in _add_file_to_tar_with_password_check
    for line in f.readlines():
  File "/usr/lib/python2.7/codecs.py", line 296, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x9f in position 3: invalid start byte

This is in what I get in update-manager gui

do-release-upgrade crashed on UnicodeDecodeError in decode(): 'utf8' codec can't decode byte 0x9f in position 3 : invalid state
share|improve this question

2 Answers 2

up vote 11 down vote accepted

Check out sources.list.d for any dotfiles (files starting with a period) containing binary garbage (which the python unicode decoder blows chunks on). I had this same problem and when I removed the dotfiles out of /etc/apt/sources.list.d/ it worked again.

share|improve this answer
2  
Had the same problem. It was a Vim undo file that was causing Python to puke. –  Dave Long Oct 22 '13 at 0:46
    
genius solution –  1_CR Oct 24 '13 at 17:24
    
I have exactly the same problem but don't have any dot files. But disabled all the extra sources and it worked. –  fccoelho Nov 6 '13 at 19:56

I had a slightly different cause and solution, but the answer by user204109 helped out on this one.

Basically, I had some non-conforming utf-8 characters in files under /etc/apt/sources.list.d/ inserted by earlier dist upgrade scripts. This is, because my native language has some non ASCII characters, and apparently the localization was not quite correct earlier.

Simplest way to find the culprits is to run:

cd /etc/apt/sources.list.d
file *.list

Then open in editor each of the files that is not listed as "ASCII text" and remove any characters that seem like garbage.

share|improve this answer

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.