57 votes
Accepted

Why are there pre-compiled packages in repositories?

It’s a trade-off: distributions which provide pre-built packages spend the time building them once (in all the configurations they support), and their users can then install them without spending the ...
Stephen Kitt's user avatar
43 votes
Accepted

How to package my software in nix or write my own package derivation for nixpkgs

NB: this answer is not yet fully complete, but it's already a good starting point. I plan to add more language-specific stuff later (or maybe to create one question per language too keep this answer… &...
tobiasBora's user avatar
  • 4,101
28 votes

Is there a tool/website to compare package status in different Linux distributions?

You can use the Repology website. Repology monitors a huge number of package repositories and other sources comparing packages versions across them and gathering other information. Repology shows you ...
Spooky's user avatar
  • 395
26 votes
Accepted

Is it safe to rename .deb file named by the standards?

Over the years, I’ve accumulated a large number of .deb packages with non-standard names, and I don’t remember running into any problems. “Famous” packages with non-standard names that people might ...
Stephen Kitt's user avatar
26 votes

Why are there pre-compiled packages in repositories?

You imply that all people have enough CPU/RAM/storage/time/knowledge to compile packages. Nope, not the case, the opposite is true, absolute most people don't want to wait e.g. hours to compile ...
Artem S. Tashkinov's user avatar
23 votes

How can I upgrade my deb package

dpkg --install package.deb should cleanly upgrade from an older version of a package to a newer one without issue. If it is complaining about a conflict, then the new package is not an upgrade but is ...
DopeGhoti's user avatar
  • 76.2k
20 votes
Accepted

What is ac_nonexistent.h?

That’s a sanity check, to ensure that the configuration script is correctly able to determine whether a header file is present or not: it asks the compiler to use a non-existant header, and checks ...
Stephen Kitt's user avatar
20 votes

Why are there pre-compiled packages in repositories?

But why even bother to "keep/offer" pre-compiled packages, when you could just compile them yourself? What are the intentions of keeping/offering them? Simple economics. Compiling an entire ...
Jörg W Mittag's user avatar
17 votes
Accepted

Why do different Linux distributions need to patch packages?

It took a few tries, but I think I comprehend what you're asking now. There are several possible reasons for a distribution to patch given software before packaging. I'll try and give a non-exclusive ...
Shadur-don't-feed-the-AI's user avatar
17 votes

How can I publish a deb package?

You have a few options: Post an RFP (Request for packaging) on Debian's WNPP. Describe your package and where to get it. Offer support since you are the developer. If a Debian Developer takes an ...
Stewart's user avatar
  • 13.7k
16 votes

How to temporarily disable and permanently disable repos in Debian based systems?

The easiest way I've found to manage repos is to have them in individual files in /etc/apt/sources.list.d/. That way, disabling the repo is as easy as moving the file from /etc/apt/sources.list.d/repo....
Chiraag's user avatar
  • 671
16 votes

Why is this Mingw-w64 package so large?

Why is this Mingw-w64 package so large? Because mingw-w64 is a meta-package providing the MinGW-w64 toolchain with a C and C++ compiler targeting all supported targets. Currently this involves four ...
Stephen Kitt's user avatar
15 votes
Accepted

How to prevent debuild from performing a clean?

Add the -nc option to your debuild command line. This may expose problems in the build system or the packaging though, so be prepared. But for small fixes it usually works fine. However, as the ...
Ferenc Wágner's user avatar
15 votes
Accepted

How can I create a proper debian postinst and postrm script?

You should delete them. Your postinst only sets file permissions; these are supposed to be set in the packaged contents, not in a post-installation script. Your postrm deletes log files, and files ...
Stephen Kitt's user avatar
15 votes
Accepted

How to create a debian package from a bash script and a systemd service?

Here’s a minimal source package which will install a shell script and an associated service. The tree is as follows: minpackage ├── debian │   ├── changelog │   ├── control │   ├── install │   ├── ...
Stephen Kitt's user avatar
13 votes
Accepted

How to generate the `Release` file on a local package repository?

There are a number of ways of going about this; I use apt-ftparchive. Create an aptftp.conf file in the root of your repository: APT::FTPArchive::Release { Origin "Your origin"; Label "Your ...
Stephen Kitt's user avatar
11 votes
Accepted

Can Guix packages be delivered to other distros?

I'm an occasional Guix contributor. Yes, you can run Guix packages on top of other distributions (GuixSD is a standalone distribution of Guix, whereas Guix itself is a package manager, so it can be ...
cwebber's user avatar
  • 126
11 votes

Why are there pre-compiled packages in repositories?

For being a gentoo user since I moved from FreeBSD Pfff! Was it ten years ago, I could not agree more with Stephen's and Artem's answers that I indeed upvote. I have never been amongst those who ...
MC68020's user avatar
  • 7,981
10 votes
Accepted

How to resume package building in debian?

To continue a build that was interrupted for some reason, you can call the appropriate targets of debian/rules directly: debian/rules build will compile the sources, then fakeroot debian/rules ...
Stephen Kitt's user avatar
10 votes

Why do different Linux distributions need to patch packages?

From the top of my head, in addition to @Shadur's answer: Some distributions discourage using embedding libraries or files provided by another package. For example, a lot of software contains ...
Edheldil's user avatar
  • 1,185
10 votes

Is it safe to rename .deb file named by the standards?

The file names are standardized mainly for the benefit of the archive maintenance software and the local cache. In the old days, before the m68k architecture was added to Debian, file names used "...
Simon Richter's user avatar
10 votes
Accepted

Is there any way to display the package contents using `apt-get` without first downloading the package?

I don't think that apt-get can do it, no, but apt-file can: sudo apt install apt-file sudo apt update And then: sudo apt-file list <pkg> For example: $ sudo apt-file list xterm xterm: /etc/...
terdon's user avatar
  • 242k
9 votes
Accepted

How to get the compiler flags that are used to build the binaries in a (.deb) package?

The compiler flags used are a function of the debian/rules file, the package's build files (since the upstream author may specify flags there too), the build system used (dh, cdbs etc.), the default ...
Stephen Kitt's user avatar
9 votes
Accepted

How can we predict when the next Debian release will be out?

See Debian Release Management; for Debian 9, it stated: As always, Debian 9 “Stretch” will be released “when it’s ready”. and that’s the general rule for all releases. The planned release date for ...
Stephen Kitt's user avatar
8 votes

What are the pros/cons of deb vs. rpm?

None of the other answers touch on these three fundamental differences with real consequences: deb files are basically just ar archives containing two compressed tarballs deb packages and the dpkg ...
mtraceur's user avatar
  • 1,166
8 votes
Accepted

Create, as a regular user, a tar with files owned by root

The extraction is what determines the ownership, not the creation of the archive. You can see that by looking at the archive's table of contents, e.,g., tar tvf dist.tar If creating the file as ...
Thomas Dickey's user avatar
8 votes
Accepted

Fail to build for Ubuntu

The error is dpkg-source: info: local changes detected, the modified files are: opsh/src/check.t That means that opsh/src/check.t doesn’t match the contents of opsh_0.1.orig.tar.gz. In Debian ...
Stephen Kitt's user avatar
8 votes

Packaging binary release on OpenBSD

The information you need is available in the Porter's Handbook (more specifically the Porting Guide therein). The summary is that you (if you want to create an official OpenBSD port) would not create ...
Kusalananda's user avatar
  • 335k
8 votes

Why is this Mingw-w64 package so large?

Yes, if you don't need the full suite, you can choose to install a specific part of it. Installing gcc-mingw-w64 will give you everything needed by C, but exclude support for C++. This might be ...
Stewart's user avatar
  • 13.7k
8 votes
Accepted

Building debian package fails when destination is /usr/local/bin

Packages aren’t allowed to ship files in /usr/local, only directories, and this is enforced by dh_usrlocal. The best fix is to follow Debian conventions and install in /usr: override_dh_auto_install: ...
Stephen Kitt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible