Compilando fácil com Debian/Ubuntu

3 Jan

As a user of the old friend gentoo I always missed the lack of possibilities to compile softwares to have a better performance.Mainly in server-side softwares like Java, PHP, Apache, Mysql and Postgres.In my tests I always felt the diference between pre-compiled versions and the softwares compiled in loco.
In Debian/Ubuntu the discover of apt-build helped me to solve the problem qith the same class and almost the same efficiency that portage.

Lets go to the step-by-step:

To install apt-build:
sudo apt-get install apt-build auto-apt

Configure your machine:
dpkg-reconfigure apt-build
Choose your architecture and the level of optimization. The medium is indicated.
The options will be saved at /etc/apt/apt-build.conf ; Lets just adjust the number of cores, in the file search for “make_options” and change as follow:
make_options = " -j4"
The number is equal to # of “cores” + 1. So a quadcore should be “-j5”.

To prevent your compiled packages to be overwriten by the official ones edit this file /etc/apt/preferences adding:
Package: *
Pin: release o=apt-build
Pin-Priority: 990

Don’t forget to add the source repositories (deb-src) to sources list and you’re done!
Now use apt-build install instead of apt-get install

Sample: sudo apt-build install xchat emesene

Quick tutorial on apt-build

apt-build install –reinstall to reinstall something
apt-build upgrade upgrade all installed softwares
apt-build world Recompile all system
apt-build remove programa Removes software
apt-build clean-build Remove compiled packages
apt-build clean-sources Remove downloaded sources.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

4 Responses to “Compilando fácil com Debian/Ubuntu”

  1. Animal-X® April 14, 2010 at %I:%M %p #

    Boa dica! É possível fazer isso no Ubuntu também.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • Handrus Nogueira April 14, 2010 at %I:%M %p #

      Olá Animal-X®,
      É possível em qualquer distro que use APT, que no fundo é a única grande dependência… Qualquer distro baseada no Debian, a princípio, deve funcionar

      Obrigado pelo comentário 😉

      VA:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
  2. Luiz Agostinho (fl0cker) January 4, 2010 at %I:%M %p #

    Massa Dr. Chronos, mas dá para compilar como no Gentoo também? Tipo escolhendo as USE flags? Ou é pedir demais? =)

    Abraço!

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    • Handrus Nogueira January 6, 2010 at %I:%M %p #

      Opa, obrigado Luiz (mesmo não sendo o Chronos… eu colaboro por aqui!)
      Ainda não se pode chegar tão fundo com o apt-build… mas acredito que esse seja um caminho natural. Entrarei em contato com os desenvolvedores do projeto perguntando sobre um roadmap. Posto as novidades aqui 😉

      VA:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)

Leave a Reply