blob

Mein Haus, meine Stra├če, mein Blob

Oct 03, 2012

Rebuilding debian packages with custom options

Let's assume foo is a package that I want to configure differently than the package maintainer does, but I don't want to go through the hassle of creating my own build scripts. Luckily, Debian (and Ubuntu) provide a way to use the package maintainer's scripts without the need to do anything yourself but enter a few simple lines into your shell.

The following commands will

  1. Download the source code of the latest version available for foo into a subdirectory of the current working directory
  2. Install all the dependencies needed to build foo
  3. Configure foo more to your liking
  4. Create installable deb-files while skipping the signing of those files (since you probably don't have the keys to do that anyway)

Notice that you don't need root for any of those commands!

apt-get source foo
apt-get build-dep foo
cd foo-4.2
./configure --with-more-awesomeness
dpkg-buildpackage -b -us -uc

If you want to, you can increase the version number of foo after configuring it by editing the debian/changelog file. Just copy the previous entry and adjust to reflect your changes.

Sep 10, 2012

Restart stuck printers on remote CUPS servers

Our CUPS servers tend to, from time to time, get stuck sending data to a printer. Once this has happended, the server pauses the printer, which leads to angry calls, since the server continues to accept jobs for said printer without notifying the Windows client machines of its status. Instead of configuring CUPS' webserver to accept connections from other machines (or using SSH -X to start a local browser), this problem can easily be solved using good old plain SSH.

  • SSH into the machine running CUPS.
  • Run cancel -a <printer> to clear the printer of all jobs, usually they accumulate some jobs until someone bothers to notify me.
  • Run cupsenable <printer> to unpause the printer.