How to set the installed size for deb package correctly?

I am developing debian packages, and I am having problems with the correct definition of "Installed-Size" in DEBIAN / control.
I created a script that constantly checks the svn repository for new changes and, if it detects some changes, then calculates the code size (excluding the DEBIAN folder) with the du -s command, and then this value is placed in the 'set size.

The DEBIAN / control file is as follows:

Package: myfirstdebpackage Version: 1.0 Architecture: all Maintainer: me Installed-Size: 16664 Depends: python (>=2.7), python-appindicator, python-numpy, python-suds Section: extras Priority: optional Homepage: www.example.com Description: My first deb package 

Application folder structure:

 myfirstdebpackage/DEBIAN myfirstdebpackage/usr/bin/myfirstdebpackage/<files> 

The first installation is going well (through the apt repository), but after creating a newer version and trying to update the package, I got a "size mismatch" or "hash sum error" error.

What's wrong?

+4
source share
2 answers

I do not expect you to change this value manually. Instead, run debuild (part of devscripts ) in the root directory of the package. The binary package will be created in this root parent directory and, of course, will automatically fill in the field for you.

0
source

I assume that you generate a binary package with the same version, but with different content each time. Do not do this. This will confuse apt and many other tools that expect and assume that each pkgname-version-arch tuple denotes a unique and different package.

Regarding the set size, dpkg-gencontrol will automatically generate it for you, but I assume that you create the DEBIAN / control file manually. I would recommend against this, because it means more manual work, which is more error prone.

0
source

Source: https://habr.com/ru/post/1497438/


All Articles