debian 配置:错误:“找不到 libcurl”

Tha*_*Guy 2 compiling source debian

我在 Linux 2.6.32-openvz-042stab120.11-amd64 OpenVZ 容器上运行 Debian 8.9 Jessie。

我正在尝试使用curlftpfs0.9.1,因为此版本具有在更高版本中删除的功能 - 即 open(read+write) 和 open(write)。

当前版本是0.9.2-9~deb8u1

apt-cache policy curlftpfs
curlftpfs:
  Installed: (none)
  Candidate: 0.9.2-9~deb8u1
  Version table:
     0.9.2-9~deb8u1 0
        500 http://ftp.debian.org/debian/ jessie/main amd64 Packages
Run Code Online (Sandbox Code Playgroud)

我能够在 Debian Snapshot 上找到二进制文件和源代码

但是,如果我尝试安装.deb二进制文件,则会得到未满足的依赖项:

# dpkg -i ./curlftpfs_0.9.1-3_amd64.deb
Selecting previously unselected package curlftpfs.
(Reading database ... 44948 files and directories currently installed.)
Preparing to unpack ./curlftpfs_0.9.1-3_amd64.deb ...
Unpacking curlftpfs (0.9.1-3) ...
dpkg: dependency problems prevent configuration of curlftpfs:
 curlftpfs depends on fuse-utils; however:
  Package fuse-utils is not installed.
 curlftpfs depends on libgnutls13 (>= 2.0.4-0); however:
  Package libgnutls13 is not installed.
 curlftpfs depends on libkrb53 (>= 1.6.dfsg.2); however:
  Package libkrb53 is not installed.
 curlftpfs depends on libldap2 (>= 2.1.17-1); however:
  Package libldap2 is not installed.

dpkg: error processing package curlftpfs (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 curlftpfs
Run Code Online (Sandbox Code Playgroud)

apt-get告诉我这些依赖项不可安装:

#apt-get install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 curlftpfs : Depends: fuse-utils but it is not installable
             Depends: libgnutls13 (>= 2.0.4-0) but it is not installable
             Depends: libkrb53 (>= 1.6.dfsg.2) but it is not installable
             Depends: libldap2 (>= 2.1.17-1) but it is not installable
E: Unmet dependencies. Try using -f.
Run Code Online (Sandbox Code Playgroud)

但是运行apt-get -f install会安装当前版本的curlftpfs.

尝试gdebi也好不到哪里去:

# gdebi curlftpfs_0.9.1-3_amd64.deb 
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Building data structures... Done 
Building data structures... Done 
Este pacote n\xe3o pode ser desinstalado
Dependency is not satisfiable: fuse-utils
Run Code Online (Sandbox Code Playgroud)

如果我将 debian-snapshot 添加到我的源列表中,我可以获得我想要的特定软件包版本,但随后我会迷失在依赖地狱中:

apt-get install -f curlftpfs=0.9.1-3+b2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 curlftpfs : Depends: libkrb53 (>= 1.6.dfsg.2) but it is not going to be installed
             Depends: fuse-utils but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@tunnelserver:~/temp# apt-get install fuse-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 fuse-utils : Depends: libfuse2 (= 2.7.3-4) but 2.9.3-15+deb8u2 is to be installed
E: Unable to correct problems, you have held broken packages.
root@tunnelserver:~/temp# apt-get install libfuse2=2.7.3-4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libselinux1-dev libsepol1-dev
Use 'apt-get autoremove' to remove them.
Suggested packages:
  fuse-utils
The following packages will be REMOVED:
  fuse gvfs-fuse libfuse-dev ntfs-3g sshfs testdisk
The following packages will be DOWNGRADED:
  libfuse2
0 upgraded, 0 newly installed, 1 downgraded, 6 to remove and 0 not upgraded.
Need to get 128 kB of archives.
After this operation, 4059 kB disk space will be freed.
Do you want to continue? [Y/n] n
Run Code Online (Sandbox Code Playgroud)

所以,我决定构建二进制文件。我从Debian Snapshot下载了源代码,应用了差异补丁,运行./configure,并得到了这个错误debian configure: error: "libcurl not found"::

# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking for g77... no
checking for xlf... no
checking for f77... no
checking for frt... no
checking for pgf77... no
checking for cf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for xlf90... no
checking for f90... no
checking for pgf90... no
checking for pghpf... no
checking for epcf90... no
checking for gfortran... no
checking for g95... no
checking for xlf95... no
checking for f95... no
checking for fort... no
checking for ifort... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for ftn... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for correct ltmain.sh version... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: creating libtool
appending configuration tag "CXX" to libtool
appending configuration tag "F77" to libtool
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for FUSE... yes
checking for gawk... (cached) gawk
checking for curl-config... no
checking whether libcurl is usable... no
configure: error: "libcurl not found"
Run Code Online (Sandbox Code Playgroud)

我找不到libcurl可以安装的软件包。我该如何继续?

Tha*_*Guy 8

我发现如果你安装了libcurl4-openssl-dev,就make不会再抱怨没有libcurl了:

apt-get install libcurl4-openssl-dev
Run Code Online (Sandbox Code Playgroud)

不幸的是,我无法解释为什么如何发生这种情况(除了安装这个难以捉摸的libcurl的包)。

但是我已经测试并确认了自己,它确实有效。所以我把这个答案留在这里。

  • 有时最好解释*为什么*某事有效,而不是仅仅给出实现某事的命令。 (2认同)
  • 谁知道——为什么假设每个人都知道你在想什么?这是一个问答网站,人们出于很多错误的原因到处张贴东西。我的建议是,发布的不仅仅是 1 行命令,并说明它解决了问题。 (2认同)