This question already has an answer here:

The below bash script was written in ~10 sec, but packaging it would take me hours of skimming through big walls of text so I ask my self if there is an easy way out there that I don't know about.

#!/usr/bin/env bash

echo "Hello World"

marked as duplicate by Sergiy Kolodyazhnyy, Jacob Vlijm, WinEunuuchs2Unix, Kevin Bowen, Eric Carvalho Jul 29 '17 at 1:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You could check this answer: create a .deb Package from scripts or binaries The answer provides a quick guide in 8 simple steps.

As an extra you could check a similar procedure for Python scripts: Create deb package for Python source and upload it to ppa at Launchpad

  • Finally a quick & dirty way to create deb's for a simple shell script. Thanks – Paradiesstaub Apr 9 '13 at 23:21

This answer was originally copied from the question it was in. It was placed here to retain the QA format.

  • First we need to install these packages: sudo apt-get install dh-make devscripts

  • Copy the script into an editor and save it as hello

    chmod u+x hello
    mkdir hello-0.1
    cp hello hello-0.1/
    cd hello-0.1/
    dh_make -s --indep --createorig
    grep -v makefile debian/rules > debian/rules.new
    mv debian/rules.new debian/rules
    echo hello usr/bin > debian/install
    echo "1.0" > debian/source/format
    rm debian/*.ex
    debuild -us -uc
    cd ..
    sudo dpkg -i hello_0.1-1_all.deb

Now entering hello into the Terminal prints 'Hello World'.

protected by Sergiy Kolodyazhnyy Jul 28 '17 at 18:52

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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