Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I installed a Debian package using the Ubuntu Software Center, and then suppose I wish to install the same program by compiling it from source. Then can I simply proceed by installing the same program compiling from source? Will this replace the previous version installed via deb package?

share|improve this question
Yes, that's correct. – ppetraki Oct 31 '12 at 15:07
up vote 0 down vote accepted

Debian packages generally install the binaries and libraries in /usr/bin/ and /usr/lib directories. Whereas when you compile the softwares from source, you are able to specify the prefix for the directories in which you want to install it. In general, the /usr/local/bin/ and /usr/local/lib directories are default in standard gnu softwares / foss (sort of de-facto standard). You can compile the softwares by specifying the prefix while running configure command. e.g. Say you want to install the software in /usr/local/ prefix, you should run these commands:

  1. ./configure --prefix=/usr/local
  2. make
  3. sudo make install

You can specify --prefix to be any directory e.g. it can be ~/.local/ or any other directory for that matter.
Now you have two binaries with the same name but in different directories installed. Which one of these will be used when you invoke the command (binary file) name, depends on the PATH variable of your shell. If the directory you installed the software is before the standard /usr/bin/ directory in the PATH variable value, it'll be run and debian one'll not be run. Check the PATH variable by running echo $PATH in terminal.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.