I've created several Python applications wherefore I know how to create a DEB and how to push an application into my PPA in Launchpad. What I never found out is how to make the application startable from the terminal by just entering its name like you use to do with any other Linux application. I guess that I have to create a link to the application's shell script in /usr/bin/ but I don't know how to do this in my rules file which looks like this:

#!/usr/bin/make -f
# -*- makefile -*-

    dh $@

    dh_install nota/* /usr/share/nota/
    dh_install applications/nota.desktop /usr/share/applications/

Frist your script has to be executable so:

chmod +x script.py

Then you have to either include the script directory in the user's PATH variable (source it in the .bashrc)


or copy/link it in a directory that already listed in PATH:

cp script.py /usr/bin/

That should do it in the make file. For the last option make has to be invoked with sudo.

| improve this answer | |
  • Make sure to strip the .py though. Commands should not have extensions. – geirha Mar 29 '12 at 20:43
  • Okay somehow I overlooked the .deb building part an just thought of a make file. I have no experience with that. My bad. Still why can't you just put ln -s /path/to/script.sh /usr/bin/commandname in your rule-file? – con-f-use Mar 29 '12 at 21:08
  • Yes, that is what I expected. I prefer to create a link to my 'script.sh' in /usr/bin/. But I still don't know how to do it. – Ralf Hersel Mar 29 '12 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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