Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly set installed-size for deb package?

I'm developing debian packages and I have troubles with correctly defining 'Installed-Size' under DEBIAN/control.
I have created a script that continuously checks svn repository for new revisions, and if found some changes then calculates code's size (excluding DEBIAN folder) with du -s command and then this value is placed to 'Installed-size'.

DEBIAN/control file looks like 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's folder structure:

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

First installation goes well (via apt repository) but after creating a newer version and trying to update package I got 'size-mismatch' or 'Hash Sum mismatch' error.

What's wrong?

like image 874
Levi Avatar asked Aug 16 '13 13:08

Levi


1 Answers

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

Regarding the Installed-Size, dpkg-gencontrol would generate it automatically for you, but I'm assuming you are creating the DEBIAN/control file by hand. I'd recommend against that, because it means more manual work which is more prone to error.

like image 182
Guillem Jover Avatar answered Sep 24 '22 18:09

Guillem Jover