Create a .deb package - simple 'hello deb' program.
Package Directory Structure
- Set up the package directory:
mkdir -p ~/hello-package/DEBIAN
mkdir -p ~/hello-package/usr/local/bin
- Add the control file:
nano ~/hello-package/DEBIAN/control
Paste the following:
Package: hello-deb
Version: 1.0
Architecture: all
Maintainer: Your Name <your.email@example.com>
Description: A simple Hello Deb package for testing .deb creating on WSL
- Create the script:
echo -e '#!/bin/bash\necho "Hello, Deb!"' > ~/hello-package/usr/local/bin/hello-deb
chmod +x ~/hello-package/usr/local/bin/hello-deb
Build the .deb Package
Run:
dpkg-deb --build ~/hello-package
You should now see hello-package.deb in your home directory
After building the package, install it using dpkg:
sudo dpkg -i ~/hello-package.deb
Run the installed script:
hello-deb
end
As you might guess, the process becomes more complex as the packages grow in functionality, adding components such as dependencies, configuration files, documentation, scripts for installation and removal, and multiple binaries or shared resources.
Some Useful Links on Debian Package Creation:
• Debian Packaging Wiki
https://wiki.debian.org/Packaging
• A Beginner's Guide to Debian Packaging (YouTube)
https://www.youtube.com/watch?v=fr_5n2hJ2eU
• Debian Repository Setup
https://wiki.debian.org/DebianRepository/Setup
• APT Sources List Configuration
https://wiki.debian.org/SourcesList
• Debian Packaging Tutorial (PDF)
https://www.debian.org/doc/manuals/packaging-tutorial/packaging-tutorial.pdf
Ben Santora - December 2024
Top comments (1)