[Bug 797006] Re: software-center package update failure due to the use of update-alternatives
After using update-alternatives to switch between python versions recently, the update of software-center failed. /usr/bin/python is not managed by alternatives. This is a symlink which belongs to the python-minimal package. You have used alternatives and changed this file. It is *not* supported for a user to change any system-managed files (using alternatives or otherwise). What you have encountered is not a bug but a safety check against users which have modified system files. ** Changed in: python-central (Ubuntu) Status: New = Invalid -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/797006 Title: software-center package update failure due to the use of update- alternatives To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-central/+bug/797006/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 797006] Re: software-center package update failure due to the use of update-alternatives
** Package changed: software-center (Ubuntu) = python-central (Ubuntu) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/797006 Title: software-center package update failure due to the use of update- alternatives To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/python-central/+bug/797006/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 797006] Re: software-center package update failure due to the use of update-alternatives
My suggestion is to change the check in /usr/share/pycentral- data/pyversions.py to directly check the python version, instead of joining /usr/bin/python and version number. Sorry I got the detail wrong. After carefully examining /usr/share /pycentral-data/pyversions.py, I think it's line 151 causing the problem: try: _default_version = link = os.readlink('/usr/bin/python') # line 151 except OSError: _default_version = None try: cmd = ['/usr/bin/python', '-c', 'import sys; print sys.version[:3]'] import subprocess p = subprocess.Popen(cmd, bufsize=1, shell=False, stdout=subprocess.PIPE) fd = p.stdout except ImportError: fd = os.popen(/usr/bin/python -c 'import sys; print sys.version[:3]') line = fd.readline().strip() fd.close() if re.match(r'\d\.\d$', line): _default_version = 'python' + line Since the link exists, line 151 returns '/etc/alternatives/python', which fails the consistency check. A quick fix is to remove line 150 to 153, as '/usr/bin/python', '-c', 'import sys; print sys.version[:3]' returned the correct 2.7. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/797006 Title: software-center package update failure due to the use of update- alternatives To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/797006/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs