Skip to content

Instantly share code, notes, and snippets.

@milkpirate
Last active August 18, 2018 20:45
Show Gist options
  • Save milkpirate/5a9e325dfe5b038c21511c415dab9450 to your computer and use it in GitHub Desktop.
Save milkpirate/5a9e325dfe5b038c21511c415dab9450 to your computer and use it in GitHub Desktop.
Force apt(-get) files to be executed with python2 - useful for debian, if you set e.g. python3 as system default
cd /usr/share/python/debpython/
\ls /usr/share/python/debpython/*.py | xargs sed -i.bak '1s|^|#!/usr/bin/env python2\n|'
cd /usr/bin/pycompile
\ls /usr/bin/pycompile | xargs sed -i '1s|^|#!/usr/bin/env python2\n|'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment