In order to create a debian package from your shell script do as follow:
Let's consider our package name is
You can copy the files into your package with the full paths on the destination filesystem. E.g. if you want to put a file in
In your
Now build the package using
This creates a dangling.deb file, which you can now install on any Debian installation with following command:
#debian #deb #create #package #dpkg #build
Let's consider our package name is
dangling
. We need to create 2 folders, first is called dangling and the second is DEBIAN
which is inside of the dangling folder:mkdir helloworld && mkdir helloworld/DEBIAN
You can copy the files into your package with the full paths on the destination filesystem. E.g. if you want to put a file in
/usr/local/bin/
you put it in dangling/usr/local/bin/
:mkdir -p dangling/usr/local/bin
cp /usr/local/bin/dangling.sh dangling/usr/local/bin/
In your
DEBIAN
directory (created at the begining of the post), create a control
file with the below content:<span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; white-space: pre;">Package: dangling
</span><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; white-space: pre;">Version: 0.1
</span><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; white-space: pre;">Maintainer: Alireza Hoseini
</span><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; white-space: pre;">Architecture: all
</span><span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; white-space: pre;">Description: would wipe all docker dangling volumes out
NOTE:
These are the mandatory fields in the control file.Now build the package using
dpkg-deb
:dpkg-deb --build dangling
This creates a dangling.deb file, which you can now install on any Debian installation with following command:
dpkg -i dangling.deb
#debian #deb #create #package #dpkg #build