How To Create Debian Packages
Note: Commands here are just for examples. They will NOT run as they are shown here. You have to adapt them to your own needs and system.
1. Create the directory to hold the project:
shell) mkdir /home/USER/debpkgs/my-program_version_architecture
2. Create a directory called "DEBIAN" inside the project directory:
shell) mkdir /home/USER/debpkgs/my-program_version_architecture/DEBIAN
3. Copy files into project root directory and include the final paths:
/usr/bin/ would be /home/USER/debpkgs/my-program_version_architecture/usr/bin/
/opt/ would /home/USER/debpkgs/my-program_version_architecture/opt/
4. Create a control file in DEBIAN:
shell) touch /home/USER/debpkgs/my-program_version_architecture/DEBIAN/control
5. Now add the necessary meta data to the control file:
Package: my-program
Version: 1.0
Architecture: all
Essential: no
Priority: optional
Depends: packages;my-program;needs;to;run
Maintainer: Your Name
Description: A short description of my-program that will be displayed when the package is being selected for installation.
6. If desired a "preinst" and/or "postinst" script can be added that execute before and/or after installation. They must be given proper execute permissions to run:
shell) touch /home/USER/debpkgs/my-program_version_architecture/DEBIAN/postinst
Add commands you'd like to run in postinst and then set the permissions to 755.
7. Now generate package:
shell) dpkg-deb --build /home/USER/debpkgs/my-program_version_architecture
The package will be in /home/USER/debpkgs
Check out https://www.ezeelinux.com for more about Linux.
Please join the discussion at EzeeTalk.
https://www.ezeelinux.com/talk/ It's free, secure and fun!
Смотрите видео How to Create .deb Packages for Debian, Ubuntu and Linux Mint онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Joe Collins (EzeeLinux) 25 Апрель 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 68,885 раз и оно понравилось 1.9 тысяч людям.