diff --git a/debuild/debian/rules b/debuild/debian/rules
index 5da272b15e1a32c0bbe72434433a09efe04b6ee4..8e5bf070840ee3c111efb2da04d199e7836e467d 100755
--- a/debuild/debian/rules
+++ b/debuild/debian/rules
@@ -40,6 +40,9 @@ override_dh_auto_install:
 # Remove some unneeded files.
 	cd debian/purr-data/ && rm -rf Makefile README.txt etc usr/share/emacs
 	cd debian/purr-data$(prefix)/lib/pd-l2ork/extra && rm -rf */*.pd_linux_o */*.la
+# Add the bash completion file again, and edit it accordingly.
+	mkdir -p debian/purr-data/etc/bash_completion.d
+	sed -e 's/pd-l2ork/purr-data/g' < scripts/bash_completion/pd-l2ork > debian/purr-data/etc/bash_completion.d/purr-data
 # Edit the library paths in the default user.settings file.
 	cd debian/purr-data$(prefix)/lib/pd-l2ork && sed -e "s!/usr/lib/pd-l2ork!$(prefix)/lib/pd-l2ork!g" -i default.settings
 # Replace the pd-l2ork desktop/mime files and icons with purr-data ones.