4.1 How to install locally compiled packages: equivs
Sometimes, people want to use an 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.
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. What it does is creating and empty package that is
able to fullfill dependencies, making the packaging 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, commaseperated>
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:
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
prefered to use the virtual package's schema, using Provides.
Now you only need to build the package:
# equivs-build name
dh_testdir
touch build-stamp
dh_testdir
dh_testroot
dh_clean -k
# Add here commands to install the package into debian/tmp.
touch install-stamp
dh_testdir
dh_testroot
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
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 carefull.
It is important to note that there are example control files in
/usr/share/doc/equivs/examples. Check them out.
4.2 Removing unused locale files: localepurge
Many Debian users use only one locale. A Brazilian Debian user, for example,
usually uses the pt_BR locale all the time and doesn't care about
the es one.
localepurge is a very useful tool for these users. You can free
lots of space by having only the locales that you really use. Just
apt-get install localepurge.
It is very easy to configure it, debconf questions guide the user in a
step-by-step configuration. Be very careful on answering the first question
though, wrong answers may remove all the locales files, even the ones you use.
The only way to recover these files is reinstalling all the packages that
provide them.
4.3 How to know what packages may be upgraded
apt-show-versions is a program that shows what packages in the
system may be updated and several useful informations. The -u
option displays a list of upgradeable packages:
$ apt-show-versions -u
libeel0/unstable upgradeable from 1.0.2-5 to 1.0.2-7
libeel-data/unstable upgradeable from 1.0.2-5 to 1.0.2-7