Posted by: jasonk2600 | January 2, 2010

Quickie HowTo: Rebuilding Debian Packages from Source

Synopsis

This quickie howto will explain the steps necessary to recompile a Debian software package on the local machine from source code.  Rebuilding Debian software packages is necessary in order to enable custom features in some software packages and/or is sometimes done to ensure that the software has been optimally compiled for running with the best possible performance on specific hardware.

Preparation

Install the software package builder bundle via the aptitude software package management utility.

# aptitude install pbuilder

 

Prepare the system to recompile the software package by downloading and installing all build dependencies required by the software package.

# apt-get build-dep PackageName
Reading package lists... Done
Building dependency tree
Reading state information... Done
  [ ... Lots of Output ... ]

 

Next, download the source code for the software package that will be recompiled.

# apt-get source PackageName
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 4121kB of source archives.
  [ ... Lots of Output ... ]

 

Rebuilding The Software

Change to the directory of the software package's source code and use the debuild utility to rebuild the software package.

# cd PackageName
# debuild -us -uc

 

Once the software package has finished compiling, install the newly created package with the dpkg utility.

# cd ..
# dpkg --install PackageName.deb

 

The newly rebuilt software package is now installed and ready for immediate use.

References

 

  [EoF]
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: