Manually built and configured CURL on Ubuntu 14.04. Still shows old version?
I have a particular box that is running Ubuntu 14.04 and can't be upgraded. I did an "apt update" and then "sudo apt install curl" and it tells me that the version I have installed, version 7.3.5, is already the latest. I need at least version 7.4 to install homebrew. I found this gist that gives a shell script to fetch and build CURL 7.50.2 from source:
https://gist.github.com/fideloper/f72997d2e2c9fbe66459
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
cd curl-7.50.2
# The usual steps for building an app from source
# ./configure
# ./make
# sudo make install
./configure
make
sudo make install
# Resolve any issues of C-level lib
# location caches ("shared library cache")
sudo ldconfig
I created a directory off of my home directory named "curl-update". I created a shell script in that directory that had the above script as its contents. I then ran it from that same directory and everything downloaded, built, and configure without error. However, when I run "curl --version" I still see 7.3.5. My guess is that although I have a newer version of curl now, it's files are not in the right place. When I execute "whereis curl" I see this:
curl: /usr/bin/curl /usr/bin/X11/curl /usr/local/bin/curl /usr/include/curl /usr/share/man/man1/curl.1.gz
Do I need to copy the newer CURL files into those directories? Is there a document that tells me how so that I don't create a mess trying to arbitrarily move files around myself?
Also, I'm a bit worried that using this manually built version may have SSL problems since 14.04 has old SSL libraries that can't be upgraded. I've gotten into trouble with that a few times with newer Python 3.X packages that aren't compatible with the current SSL libraries on the box. Will this be a problem?
My guess is that although I have a newer version of curl now, it's files are not in the right place.
Yes. Please check the output you have seen while executing the script, in particular the sudo make install
step, to see where it got installed (probably in /usr/local
).
Also try which curl
to see which one you are executing.
Do I need to copy the newer CURL files into those directories?
There are multiple ways to handle this: (1) You can use the full path to the executable you want, (2) you can set PATH
in the correct order to get the executable you want.
I do set the PATH
in my .profile
.
With respect to the comment:
To replace the old version, the configuration is: 1. (autotols): ./configure --prefix=/usr ...
If you do it this way, first you won't be sure that the old files are completely overwritten (if file names have changed, which may or may not be the case), and second this will go away as soon as the package manager installs another version of curl.
It is much cleaner to keep your manually compiled programs in another hierarchy (/usr/local
is the recommended one). However, this often requires not blindly executing some scripts you found on the internet to install something, but familiarity with ./configure
and the whole process.
Also, I'm a bit worried that using this manually built version may have SSL problems since 14.04 has old SSL libraries that can't be upgraded. I've gotten into trouble with that a few times with newer Python 3.X packages that aren't compatible with the current SSL libraries on the box. Will this be a problem?
Maybe, maybe not. But just as you can manually compile and install curl, you can also manually install and compile newer SSL libraries (and the compile curl against those). Again, this needs familiarity with the way those things work, and LDFLAGS
, the various ways packages can produce them, etc. Sorry, I don't know an easy tutorial.