Debian package naming convention

debianpackage-managementpackaging

It's all very confusing. There are different examples out there, for e.g.:

<package-name>_<epoch>:<upstream-version>-<debian.version>-<architecture>.deb

source: debian package file names

Is section 5.6.12 Version or the Debian Policy Manual also related to the actual package filename too? Or only to the fields in the control file?

In this wiki topic about repository formats it doesn't really say anything about conventions, same in the developers best practices guide.

Maybe I'm just looking for the wrong thing, please help me and tell me where to find the Debian package name conventions. I'm especially curious where to put the Debian codename. I want to do something like this:

<package-name>_<version>.<revision>-<debiancodename>_<architecture>.deb

where <debiancodename> is just squeeze or wheezy.

Best Answer

My understanding is that you want to distribute/deploy a package to multiple Debian based distributions.

In the Debian/Ubuntu world, you should not provide individual .deb file to download and install. Instead you should provide an APT repository. (in the Fedora/Red Hat/CentOS world I would make a similar advice to provide a YUM repository). Not only does is solves issue of how to name deb file, but repository is an effective way to provide newer version of your package, including bug-fix and security updates. Creating an APT repository is beyond the purpose of this page/question, just search for "how to setup an apt repository"

Now back to your question: "package naming convention":

When you generate the package with dpkg-buildpackage, the package will be named in a standard way. Quoting dpkg-name manpage:

A full package name consists of package_version_architecture.package-type as specified in the control file of the package.

package_version_architecture.package-type

The Debian Policy is the right place to know the syntax of the control files: name (for both Source and binary packages), version, architecture, package-type.

There is no provision to state the distribution, because this is not how the way thing goes.

If you need to compile the same version of a package for multiple distributions, you will change the version field (in the debian/changelog and debian/control file). Some people use the distribution name in the version field. for example openssl:

0.9.8o-4squeeze14 
1.0.1e-2+deb7u14
1.0.1k-1 

If that's what you want to do, make sure to read debian-policy about debian_revision in version.

Related Question