Compiling from Source from the Ubuntu Repositories

You might sometimes want to recompile a package, even though a binary package is available in the Ubuntu repositories. For example, a program might have been compiled into a binary with a specific feature disabled that you would like to use. Here is how you can do this. We will call the software package we want to compile foo.

First, get the source from the Ubuntu repositories:

matthew@seymour:~$ apt-get source foo

Install the build dependencies for the package:

matthew@seymour:~$ sudo apt-get build-dep foo

Change to the directory for the source code (may include the version number):

matthew@seymour:~$ ...

Get Ubuntu Unleashed 2014 Edition: Covering 13.10 and 14.04,Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.