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.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Sony Settles in Linux Battle
- Libarchive Security Flaw Discovered
- Profiles and RC Files
- Maru OS Brings Debian to Your Phone
- The Giant Zero, Part 0.x
- Snappy Moves to New Platforms
- Understanding Ceph and Its Place in the Market
- Git 2.9 Released
- Astronomy for KDE
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide