Linux Foundation and Application Development Series III: Building deb software packages

Table of contents

deb package

concept

rpm package

concept

dpkgtools

concept

Common commands

deb package file structure analysis

Build a helloworld deb package

apt command and apt-get command

Understand what makes up a Linux package

file type save directory
normal procedure /usr/bin
root privilege program /usr/sbin
program configuration file /etc
log file /var/log
document file /usr/share/doc

Linux package

The computer can only recognize machine language as binary language. When installing the source code package, you need to use a compiler to compile the source code package into an executable file.

  • source package

    advantage:

    • open source free

    • Free crop function

    • modify source code

    shortcoming:

    • Installation steps are cumbersome

    • long compile time

    • Newbies can't solve compilation problems

  • binary package

    advantage:

    • easy to use

    • fast installation

    shortcoming:

    • Unable to read and modify source code

    • Can't crop features

    • strong dependence

deb package

concept

Software installation packages for Linux distributions such as Debian, Ubuntu, and Deepin.

rpm package

concept

Software installation packages for Linux distributions such as RedHat, Fedora, and Centos.

dpkgtools

concept

The underlying package management tool is mainly used to manage the deb packages that have been downloaded and installed locally

Common commands
Install the software: dpkg -i xxxx.deb
View the installation directory: dpkg -L xxxx
Display version: dpkg -l xxxx
Details: dpkg -s xxxx
List the content: dpkg -c xxxx.deb
Uninstall the software: dpkg -r xxxx
deb package file structure analysis
  • DEBIAN directory:

    • control file:

      • Package: software name

      • Version: version

      • Section: Software category

      • Priority: Importance to the system

      • Architecture: supported hardware platforms

      • Maintainer: The maintainer of the package

      • Description: A description of the software

    • preinst file: shell script executed before installation

    • postinst file: shell script executed after installation

    • prerm file: shell script executed before uninstallation

    • postrm file: shell script executed after uninstallation

    • copyright file: copyright statement

    • changlog file: modification record

  • Software specific installation directory:

    Depending on actual needs

Build a helloworld deb package

Demo: dpkg -b

other:

dpkg-buildpackage

checkinstall

...

apt command and apt-get command
  • apt is the new package management tool

  • Solve the problem that the apt-get command is too scattered

  • The default properties of apt are user-friendly (progress bar, prompt to upgrade

Guess you like

Origin blog.csdn.net/qq_51519091/article/details/132112584