0

If I've changed the target of /usr/bin/python from /usr/bin/python2.7 to /usr/bin/python3.2 (I realize this was an ABSOUTELY HORRIBLE idea) in Ubuntu 12.04.1 LTS. Afterwards, several applications, including software-center and update-manager have stopped working. Insofar as I can tell, this is because they are written in Python2.7. I replaced the default /usr/bin/python shebang with the 2.7 one, and this fixes them on the application level. Switching /usr/bin/python back to /usr/bin/python2.7 really isn't an option, but is there a list of all applications installed by default in Ubuntu 12.04.1 LTS, if installed from a new CD-R, that use a shebang of #!/usr/bin/python instead of #!/usr/bin/pythonX.Y?

2
  • grep ^\#\!/usr/bin/python / -R -- but bear in mind this won't work, as many will use #!/usr/bin/env python
    – Sirex
    Sep 6, 2012 at 1:16
  • 3
    "Switching /usr/bin/python back to /usr/bin/python2.7 really isn't an option". Why isn't it? You can always use python3.2 in the shebang if you need it for a specific app.
    – Renan
    Sep 6, 2012 at 1:59

1 Answer 1

1

You could boot from a live-CD then grep the files in /usr/bin to find what uses Python.

But what do you want to achieve with that? Many applications haven't been ported to Python 3, often due to the lack of libraries: many don't have a Python 3 version yet, or it's still buggy. You're asking for troubles.

If you just want to use Python 3 for your programs, you can use the shebang #!/usr/bin/python3.2 or #!/usr/bin/env python3.2.

You must log in to answer this question.

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