I am in the process of compiling vsftpd, but keep getting this error:

[alex@lab vsftpd-3.0.3]$ make
gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o \
privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o \
str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o \
ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o \
ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o \
ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o seccompsandbox.o \
-Wl,-s -fPIE -pie -Wl,-z,relro -Wl,-z,now 


/usr/bin/ld: cannot find -lcap

collect2: error: ld returned 1 exit status

make: *** [vsftpd] Error 1

I installed libpcap 1.9.0, yet the error persists.


Since you're building code from source, you need the libcap.so unversioned shared library. These are typically provided as part of the corresponding -devel package. If you're not sure of the package name, you can run something like:

sudo yum install /usr/lib64/libcap.so

Although in this case, the answer is that you simply need to install the libcap-devel package:

sudo yum install libcap-devel
  • That makes sense! However - I should have mentioned this in my first post - I am working on a system that is not connected to the Internet. Hence me downloading the necessary library tar files and transferring them onto the target system manually. On the target system, I then run make, which leads me to the error. – Alex Teichmann Feb 11 at 19:50
  • I don't think that changes the nature of the error or the solution. Download the libcap-devel package, transfer it to the target system, and install it. However, you should also be able to create a symlink to the existing versioned library, like ln -s libcap.so.2 /usr/lib64/libcap.so. – larsks Feb 11 at 21:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.