Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
1  
Yes, that's correct. –  ppetraki Oct 31 '12 at 15:07

1 Answer 1

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

 
discard

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.