Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a python script that I want to package for Debian. I use a debian/install file where I wrote /usr/bin/

Linitan then complains about the .py extension (script-with-language-extension).

I then changed it to /usr/bin/

which causes an error because it interpreted as a directory.

How can I do the rename there? I do not want to rename my python script in the sources.

share|improve this question
up vote 11 down vote accepted

You cannot rename files using dh_install (via the debian/install). You will need to rename it during the debian/rules "build" target before you get to the dh_install invocation.

share|improve this answer
so it will be build: \\ mv autodice? – Martin Ueding Apr 5 '11 at 21:38
likely the mv would happen in the target directory rather than the build directory, but yeah, you'd have to add the move before calling dh_install. – Kees Cook Apr 7 '11 at 1:39
For a bug report requesting this feature, see – Bernhard Reiter Mar 21 '12 at 19:39
@Kees Cook: if you rename it in the target directory - would apt-get still be able to remove the file after package removal/upgrading? – zerkms May 27 '13 at 22:34

From Debian bug 245554 already mentioned:

this can already be easily solved if you use dh >= 9 and dh-exec. Just make your .install file executable, add #!/usr/bin/dh-exec to the top, and you can use "source => dest", like this:

debian/default.conf => /etc/my-package/start.conf
share|improve this answer

Your Answer


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.