How to make a debian package adhere to the naming convention
Many applications refuse to work with Debian packages that do not follow the naming convention, also in the metadata. If you use software management it is required to provide a package that follows the debian naming scheme as explained below.
This documentation provides you with a way to adjust packages that do not follow the standard. We have seen that many commercial software vendors violate the guidelines and/or the meta description is wrong,
It is important to adhere to Debian naming conventions, also in meta description
In Debian systems packages need to adhere to the Debian naming convention.
A typical example is the
chromium_83.0.4103.116-3.1_arm64.deb Chromium package.
Or, in a more general notation:
Sometimes packages have a wrong meta description. They use for example
name-0.0.3-all.deb. This needs to be changed or you will get an error.
A very useful check for correct file name is to run
dpkg -I package.deb. This will show the meta information for the package and this is how the file should be called. In the example below we run
dpkg -I chromium_83.0.4103.116-3.1_arm64.deb and get the following output. Relevant name parts are highlighted in red:
Let's assume that you have a debian package where the package metadata does not match the package file name. This causes a problem for the qbee agent. To save bandwidth it will inspect the package filename and parse it into
<arch>. So, if
<version> in the package metadata is 5.0.0, but the
<version> parsed from the filename differs, qbee-agent will continuously try to install the package. Also, the package will be reported by the package manager as 5.0.0, which makes it impossible to do auditing to understand if you have devices running an old version.
However, there is a way to repackage the deb file to add the correct metadata. On a debian/ubuntu instance, do the following
Create a directory and move the package you want into it. Then in a terminal in that directory run:
$ mkdir oldpack newpack
$ dpkg-deb -R wave-client-22.214.171.124634-linux_arm64.deb oldpack
This will unpack the current binary
Edit the package control file with a text editor of your choice and set Version:
Save the file and close the file editor
Repackage the file under the newpack directory. This will use the metadata in the control file above and create a correct package name
$ dpkg-deb -Z xz -b oldpack newpack
This might take a while due to the size of the package. You will now have a new package 'newpack/hanwha-client_126.96.36.199634_arm64.deb'
Compare the package metadata of the old package and the new. The only thing that should have changed is the version
$ dpkg -I wave-client-188.8.131.52634-linux_arm64.deb
$ dpkg -I newpack/hanwha-client_184.108.40.206634_arm64.deb
Do a manual install of 'newpack/hanwha-client_220.127.116.11634_arm64.deb' on a compatible device to make sure the new package works correctly. Now you can upload it to the qbee file manager and change definitions in your qbee configuration.
Unfortunately, you'll need to do this every time you want to upgrade the package. So the best solution is to convince the package provider to package it correctly in the first place.