我在 FreeBSD 10.1 设置上重新安装 ProFTPD 时遇到了问题。服务器刚刚从 10.0 升级到 10.1。当我启动 make install clean 过程时,屏幕上首先显示这些警告。
===> proftpd-1.3.5_4 depends on shared library: libpcre.so
/usr/share/misc/magic, 93: Warning: Printf format `l' is not valid for type `lelong' in description `, %ld pages'
...
/usr/share/misc/magic, 15118: Warning: Printf format `l' is not valid for type `belong' in description `Volume %ld,'
/usr/share/misc/magic, 15609: Warning: Current entry does not yet have a description for adding a MIME type
file: File 5.19 supports only version 12 magic files. `/usr/share/misc/magic.mgc' is version 8
[: =: unexpected operator
- not found
过了一会儿,make 过程停止并出现以下错误:
/bin/ln -s libpcre.so.1 /usr/ports/devel/pcre/work/stage/usr/local/lib/libpcre.so.3
====> Compressing man pages (compress-man)
===> Installing for pcre-8.35_2
===> Checking if pcre already installed
===> pcre-8.35_2 is already installed
You may wish to ``make deinstall'' and install this port again
by ``make reinstall'' to upgrade it properly.
If you really wish to overwrite the old port of pcre
without deleting it first, set the variable "FORCE_PKG_REGISTER"
in your environment or the "make install" command line.
*** Error code 1
Stop.
make[3]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[2]: stopped in /usr/ports/devel/pcre
*** Error code 1
Stop.
make[1]: stopped in /usr/ports/ftp/proftpd
*** Error code 1
Stop.
make: stopped in /usr/ports/ftp/proftpd
似乎文件 /usr/share/misc/magic.mgc 的版本不对?当我从 10.0-RELEASE-p12 升级到 10.1-RELESE-p1 时可能会发生这种情况?
如果我运行 make install 清除 ProFTP 端口,并禁用对 pcre 的支持,则该过程和安装将成功。但我认为仍然有些问题?
我的编程技能有限,而且也会出现这种程度的错误。如果你有什么想法,请告诉我,
谢谢,
答案1
端口 Makefile 中的依赖性检查用于file(1)
检查文件是否为共享库。
看来您file
用于确定文件类型的魔法数据库已损坏。您可以按如下方式重新创建它,假设您已安装 FreeBSD 源代码。
首先,创建文本格式的总数据库;
cat /usr/src/contrib/file/magic/Header \
/usr/src/contrib/file/magic/Localstuff \
/usr/src/contrib/file/magic/Magdir/* >magic
然后编译它;
file -C magic
现在将两者安装到默认位置。这需要以 root 身份完成;
install -m 644 magic magic.mgc /usr/share/misc/