Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Managing Debian Software with APT (apt-get etc)
Prev Home Next

Chapter 4 - Very useful helpers

4.1 How to install locally compiled packages: equivs

Sometimes, people want to use a specific version of a program available only on source code, with no Debian package. But the packaging system can be a trouble when doing this. Suppose you want to compile a new version of your email server. All is fine, but many packages in Debian depend on an MTA (Mail Transport Agent). Since you installed something you compiled by yourself, the packaging system doesn't know about it.

That's where equivs enters the scene. To use it, install the package with that name. Equivs creates an empty package that fullfills dependencies, making the package system believe that the dependencies are satisfied.

Before we begin, it is good to remind you that there are safer ways of compiling a program which is already packaged for Debian with different options, and that one should not use equivs to replace dependencies if you don't know what you are doing. See section Working with source packages, Chapter 6 for more information.

Let's continue with the MTA example, you just installed your new compiled postfix and goes on for installing mutt. Suddenly you discover that mutt wants to install another MTA. But you already have yours.

Go to some directory (/tmp, for example) and run:

     # equivs-control name

Replace name for the name of the control file you want to create. The file will be created as follows:

     Section: misc
     Priority: optional
     Standards-Version: 3.0.1
     Package: <enter package name; defaults to equivs-dummy>
     Version: <enter version here; defaults to 1.0>
     Maintainer: <your name and email address; defaults to username>
     Pre-Depends: <packages>
     Depends: <packages>
     Recommends: <packages>
     Suggests: <package>
     Provides: <(virtual)package>
     Architecture: all
     Copyright: <copyright file; defaults to GPL2>
     Changelog: <changelog file; defaults to a generic changelog>
     Readme: <README.Debian file; defaults to a generic one>
     Extra-Files: <additional files for the doc directory, comma-separated>
     Description: <short description; defaults to some wise words>
      long description and info
      second paragraph

We just need modify this to do what we want. Have a look at the field's format and to their descriptions, there's no need to explain each one here, let's do what's required:

     Section: misc
     Priority: optional
     Standards-Version: 3.0.1
     Package: mta-local
     Provides: mail-transport-agent

Yes, that's all. mutt depends on mail-transport-agent, that is a virtual package provided by all MTAs, I could simply name the package mail-transport-agent, but I preferred to use the virtual package's schema, using Provides.

Now you only need to build the package:

     # equivs-build name
     touch build-stamp
     dh_clean -k
     # Add here commands to install the package into debian/tmp.
     touch install-stamp
     dpkg-deb: building package `name' in `../name_1.0_all.deb'.
     The package has been created.
     Attention, the package has been created in the current directory,

And install the resulting .deb.

As one can see, there are several uses for equivs. One can even crate a my-favorites package, which depends on the programs you usually installs, for example. Just free your imagination, but be careful.

It is important to note that there are example control files in /usr/share/doc/equivs/examples. Check them out.

Managing Debian Software with APT (apt-get etc)
Prev Home Next

  Published under the terms of the GNU General Public License Design by Interspire