APT-build — optimize your Debian!

[ Friday, 23 November 2007, P2O2 ]

Certainly most of the Linux users would like to have their systems fully optimized for their rigs but do not have the stamina or enough knowledge to play with the Gentoo installation paradigm. But here comes the rescue — an apt-build goody available under every distro armed with the big gun - APT package manager.

Author: Gallus Annonimus

Time to make the beast work for us. First we have to install it. Issue the command:


apt-get install apt-build

Now it’s time to configure it. In doing so, we’ll be asked for an optimization level — whether we want to create an apt-build repo for APT, and a question about processor architecture. Of course all options can be reconfigured in this way:


dpkg-reconfigure apt-build

The above command offers two additional options for the gcc compiler and make builder. Their descriptions can be found in system manuals: man gcc and man make.

Optimizing system

Let’s go to the next step and start optimizing our system. Our program makes use of deb-src entries contained in the etc/apt/sources.list file. Thanks to the source addresses compilation and installation processes are fully automatic (similar to emerge found in Gentoo). Apt-build downloads sources of the main application and its dependencies, compiles them, creates a deb package, and finally installs the package.

We are offered a broad spectrum of options. I list only a few basic ones:

  • apt-build update — updates repo list,
  • apt-build upgrade — updates operating system,
  • apt-build install program — installs an application,
  • apt-build world — something for hard-core users, it recompiles whole system!

Other useful options:

  • --noupdate — useful for underpowered machines and when we do not want to update repos (apt-build refreshes repos with every invocation),
  • --yes — we do not have time to approve every stupid question during program installation,
  • --force-yes — we approve unauthorized packages (ATTENTION: apt-build does not install unauthorized packages — what’s worse is it won’t ask us for this; the option’s highly recommended),
  • --reinstall — reinstalls a package,
  • --rebuild — builds a package from the beginning.

Make your Debian anew!

Anyone ready to jump to the deep waters of system recompilation, after reading above remarks, has to acquaint himself with a few things without which the compilation process will not yield.

At first the apt-build command should spit out the message:

-----Rebuilding the world!-----

-----Building package list-----

Please read README.Debian first.

Of course, the system failed to rebuild due to the fact it didn’t have a full list of system packages. We’ll try to amend this omission with the following command (it can be issued in one row without the backslash too):


dpkg --get-selections | awk '{if ($2 == "install") print $1}'> \

 /etc/apt/apt-build.list

I suggest to add two options — --yes and --force-yes — to make the rebuilding process fully automatic. Recompilation should start without a problem now. But you will never achieve 100% certainty that the compilation will go smoothly, that it will not stop at some point even after you’ve made every theoretical precaution.

But what about USE flags?

A lot of you wonder whether we could have accessed USE flags, as we were able to recompile our system like Gentoo distros. For those uninitiated into compilation secrets: USE flags are special options for portage (Gentoo package control system). They free us from typing a lot of compilation options. For example, if we use GNOME and we do not need KDE parts we can preset the compiler to process applications for the first graphical environment only. Sorry, but apt-build cannot manage USE flags.

In spite of being at an early stage of development, the program is promising. In my opinion it will be able to compete with Gentoo’s portage in the future. But as for today, the apt-build system it too young and underdeveloped to compete with the stable, mature, and easy to use portage. Anyway, don’t worry. Debian wasn’t created to be compiled by users, contrary to Gentoo. Users should make use of Debian’s gigantic default repositories of ready-to-use binaries. But who from us, the users, never wanted to optimize his system in the past and wouldn’t like to optimize it in the future?

 

Translated by P2O2, Proof-read by Jake Conroy

Subscribe to RSS feed for this article!

3 Comments

fold this thread bob f  Saturday, 24 November 2007 o godz. 2:22 pm #  Add karma Subtract karma  +0

I have used apt-build in the past, and if I remember correctly only the explicity named application was built. The dependencies binaries where downloaded/installed and the named package only was built. IMHO, Gentoo’s USE flags are what makes building from source make sense and without these, I found apt-build to be more of a novelty.

fold this thread vook  Wednesday, 2 April 2008 o godz. 2:40 am #  Add karma Subtract karma  +0

The term “Gentoo’s USE flags” implies that you believe that this is something that Gentoo has created and/or offers that other distributions and UNIX variants do not. Gentoo just tells you about them right away during the install. You can always completely customize the compilation process by creating a make.conf file in /etc - (linux didn’t invent this either btw - it’s been around a long time).

No, apt-build is not a novelty. It just doesn’t hold your hand the way Gentoo’s documentation does.

Nothing against Gentoo btw - it has gotten people excited about Linux in a way other distributions have not - and it has outstanding documentation. I just hope people realize that Gentoo doesn’t offer anything that wasn’t available before. If I really want the fastest and most optimized open OS around and I’m willing to tediously build it from scratch, I’ll pass on Gentoo and go straight for FreeBSD (or one of the others).

 
 
fold this thread Catnap  Sunday, 25 November 2007 o godz. 10:36 pm #  Add karma Subtract karma  --1

I tried apt-build a year or two ago. IIRC, “apt-build world” failed after a couple of hours of compiling. It might work better in the future because, AFAIK, Debian developers now do more automatic build testing than they used to in the past. (They don’t use apt-build to do this testing, though. ;-)

Nowadays I dual boot between the good old binary-Debian and a source-distro called Source Mage that is designed from the ground up to build all packages from source. The easy-to-use “sorcery” package manager in Source Mage is written in Bash and they try to avoid adding any patches or distro-specific configurations to packages, so Source Mage is refreshingly different from Debian. I love both of these distros.

 
Name (required)
E-mail (required - never shown publicly)
URI

Adjust field size: shrink | enlarge)

You can use simple HTML in your comments. Some examples are as follows:
  • A hyperlink: <a href="polishlinux.org">GNU/Linux for everyone!</a>,
  • Strong text: <strong>Strong text</strong>,
  • Italic text: <em>italic text</em>,
  • Strike: <strike>strike</strike>,
  • Code: <code>printf("hello world");</code>,
  • Block quote: <blockquote>Block quote</blockquote>

About the Author

Przemysław Pawełczyk

Sponsors

RSS: Comments

You can follow the comments to this article through a special channel RSS 2.0 .

Related articles: Debian

 more »

PolishLinux Top Content

Select distros:

vs

Shopping Ads

Google Ads