For the most part, software installed from the repository can and sometimes will overwrite source-built software. If you want to stop this from happening (i.e. have another source built version lingering on your system, and easy to remove), then continue reading. It is always advisable to set up the source build so that it installs to a different directory. If you want to get the Ubuntu version of the software back, you run
sudo apt-get install --reinstall libcurl3
First of all, you should read the README or INSTALL file of the source code to understand the parameters. That way, you absolutely know the parameter to parse and to which command you should send it to. But below is a generic way that works on most source builds in my (admittedly) limited experience
Compiling from source
Since the best practice is to use checkinstall
, we will install this first:
sudo apt-get install checkinstall
This will make your life easier when removing compiled packages, as noted by apmouse.
Quite often a parameter for ./configure
is --prefix <directory>
and is used like this:
auto-apt run ./configure --prefix=/opt/libcurl
and then you do the rest of the source build dance:
make
sudo checkinstall
and the make
command will create the directory and install your files for you.
Removing the built package
If you ever need to remove your source files, you can just run:
sudo dpkg -r libcurl
If you need the files to be accessible from the terminal, then look at this AskUbuntu question for some ideas on how to add your new path to the $PATH
variable.
prefix
is usable in curl, as noted in the install instructions, thanks. – Stefan Rogin Apr 30 '13 at 13:10