curl64-bitubuntu-11.04

Ubuntu 64bit 11.04 server and curl install fail


So I wanted to install curl with HTTPS protocol, I did it like so:

  1. sudo -i wget http://curl.haxx.se/download/curl-7.21.6.tar.bz2
  2. sudo -i tar jxf curl-7.21.6.tar.bz2
  3. sudo -i rm curl-7.21.6.tar.bz2
  4. sudo -i cd curl-7.21.6/
  5. sudo -i ./configure
  6. sudo -i make prefix=/usr/local all
  7. sudo -i make prefix=/usr/local install

and last I tried: sudo -i curl --version to see if I succeeded and the answer was "No!". The error I got is here:

curl: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

Solution

  • prefix=/usr/local should be set in configure instead, like:

    ./configure --prefix=/usr/local
    

    Not in make. However, configure sets prefix to /usr/local by default in autotools, so you don't need to specify that anyways. Then just run:

    make clean && make && sudo make install
    

    Note that when compiling code, you should always do it as a standard user, not as sudo or root. Only do it for make install, which is where you actually need permissions to do things like chmod and moving files around. Let me know if that works for you.