Suppose I have a makefile that builds my package, and I only want the package to build if the package file is not present:

package: foo_0.0.0_amd64.deb
  cd foo-0.0.0 && debuild -uc -us

So I am new to the debian build process, but I am anticipating that I'll either find a way to build for different architectures, or I'll be on a different architecture natively and that file name will change. So, I set it as a variable:

package: foo_${major}.${minor}.${update}_${release}.deb

I have a machine where uname -r yields #.##.#-#-amd64. What is the bulletproof way to fetch that amd64 in unix/linux?


On a Debian-based system, the bullet-proof way of determining the architecture, as appropriate for use in a package’s file name, is

dpkg --print-architecture

Note that architecture-independent packages use all there, and you’d have to know that in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.