Using Checkinstall To Build Packages From Source
Checkinstall is a utility that builds a .deb, .rpm or Slackware package from a third party source code tarball. This allows you to introduce such third party software using the standard package management features of your distribution. In contrast, the conventional instructions for installing such software packages puts your package manager out of sync with the actual collection of software installed on your Linux box.
This short tutorial presumes that you're using a Debian-derived distribution such as Ubuntu, although it should work with most distributions. It also presumes that you have some prior experience of building a package from the source code.
For most users, the preferred method of adding software to a Linux system is by using a package manager. Package management is very reliable these days, and apart from anything else, it offers an advantage that Linux systems enjoy. However, what do you do when a package that you need isn't in the repository of your chosen distribution, or it is in there but it's an old version? In such cases, there is often nothing else for it but to build from source.
Building from source is a reasonably simple process, but it brings with it a few problems. For a start, you're circumventing the package manager, and this puts its internal database out of sync with the software installed on your computer. You can even end up with two versions of an application installed simultaneously which can cause all sorts of problems.
Thankfully, there is a tool called Checkinstall that is designed to sort out this mess. Checkinstall takes a compiled source code tarball and turns it into a Debian, Slackware or RPM package that you can install “officially” via the package management tools. Furthermore, you can distribute the finished package so that other people can install it without having to build from the source code. Best of all, it's very easy to use if you already know how to build packages from the source. Checkinstall is not included by default in some distributions, so you might have to search for it and install it via the package manager.
The normal process for building a package from source is begun by, having first downloaded and unpacked the source code from the maintainer's website, navigating to the the source code directory and typing:
Once the configuration process has completed, you then type:
which builds the source code, followed by:
sudo make install
which installs the package. However, the official instructions typically encourage you to circumvent the advantages of a package manager, and this is the part that causes the problem . Instead of invoking “sudo make install” type:
Checkinstall will begin the process of creating a .deb package (in the case of a Debian style system) and installing it. Before carrying out the actual build you'll be asked a series of questions. If you merely want to build a package to add to your own system, you can safely accept the default answers. However, if you intend to distribute the finished package, it's a good idea to fill in some of the fields such as your contact details and any other important notes.
It's worth noting that, as with most command line tools that install packages, you must make sure that no other package management tools are running when you run Checkinstall. If you merely want to create the .deb without carrying out the installation, use the command line switch
sudo checkinstall --install=no
Creating an Ubuntu package for Beebem, a BBC Micro emulator
I wonder if I'm the only one who thinks that Checkinstall should be more prominently featured in most distributions, perhaps with a GUI front end of some sort?
The Checkinstall website.
UK based freelance writer Michael Reed writes about technology, retro computing, geek culture and gender politics.
|Reglue: Opening Up the World to Deserving Kids, One Linux Computer at a Time||Jul 29, 2014|
|diff -u: What's New in Kernel Development||Jul 23, 2014|
|Great Scott! It's Version 13!||Jul 21, 2014|
|Adminer—Better Than Awesome!||Jul 17, 2014|
|It Actually Is Rocket Science||Jul 16, 2014|
|Android Candy: Repix, Not Just Another Photo App||Jul 14, 2014|
- Reglue: Opening Up the World to Deserving Kids, One Linux Computer at a Time
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Numerical Python
- RSS Feeds
- Tech Tip: Really Simple HTTP Server with Python
- How to Set Up and Use Tripwire
- NSA: Linux Journal is an "extremist forum" and its readers get flagged for extra surveillance
- diff -u: What's New in Kernel Development
- Video Art: Experimental Animation and Video Techniques in Linux
- Driving Me Nuts - Things You Never Should Do in the Kernel