3

As an example I've installed libcurl v7.30 from source, using their tutorial:

./configure --disable-ipv6 --enable-ares
 make
 make install

I've had libcurl installed from the official repository prior to this.

Would the install be overwritten by automatic updates? If yes what is the proper way to install from source and not mess with official installations.

If the package is already installed should it be removed before a new install?

I guess an alternative would be to install in a diferent folder, but how wouldn this change usage? (in my case compiling) and would it cause problems with references?

1 Answers1

4

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.

somoso
  • 666