Deb is the package format of Debian Linux. In general, we need to compile the source code and then create a deb package. Today, due to work needs, we want to package some existing files into a deb package, so we are struggling to find and study how to deal with it, finally, a package was created at three o'clock P.M. And practice it by yourself to ensure the correctness of each step and the final result. Details are as follows: I am operating on Ubuntu7.10. to package the files under the/usr/src/soft directory, these files will be released to/usr/src/sof when the package is unwrapped.
Deb is the package format of Debian Linux. In general, we need to compile the source code and then create a deb package. Today, due to work needs, we want to package some existing files into a deb package, so we are struggling to find and study how to deal with it, finally, a package was created at three o'clock P.M. And practice it by yourself to ensure the correctness of each step and the final result. The details are as follows:
I am operating on Ubuntu 7.10 and want to package the files under the/usr/src/soft directory. When I unpack the files, they are also released to the/usr/src/soft directory.
First, create a working directory, for example, create a work directory under the user lionel directory:
# Cd/home/lionel
# Mkdir work
# Cd work
When installing the software package, the file is released to the root directory by default, so you can set its path, and we also need to create a DEBIAN directory:
# Mkdir-p usr/src
# Cp-a/usr/src/soft usr/src
# Mkdir DEBIAN
A key step is to create a control file in the DEBIAN directory using the following method and add the following content to it:
# Cat> DEBIAN/control <Package: soft
Version: 1.0.1
Section: utils
Priority: optional
Architecture: i386
Depends:
Installed-Size: 512
Maintainer: Linuxidc@126l.com
Description: soft package
EOF
Then you can use the dpkg command to build the deb package:
# Dpkg-B./home/lionel/soft_1.0.20.i386.deb
The generated package is in the/home/lionel directory.
From the perspective of the whole process, the control file is very important, so we need to ensure its correctness. For the specific meaning of the metadata and why the data is needed, I will take a closer look at it later. Note that each command is prefixed with "#". You must use the root permission to perform these operations.