安装pure-ftpd时出错

在我的Ubuntu 12.04.04 LTS服务器上安装pure-ftpd时,出现了一个非常奇怪的错误。

我正在用sudo用户运行这个命令。

sudo apt-get install pure-ftpd 

我得到这个错误

 Processing triggers for man-db ... Processing triggers for ureadahead ... Setting up pure-ftpd (1.0.35-1) ... Starting ftp server: File/Basename.pm did not return a true value at /usr/sbin/pure-ftpd-wrapper line 23. BEGIN failed--compilation aborted at /usr/sbin/pure-ftpd-wrapper line 23. invoke-rc.d: initscript pure-ftpd, action "start" failed. dpkg: error processing pure-ftpd (--configure): subprocess installed post-installation script returned error exit status 5 Errors were encountered while processing: pure-ftpd E: Sub-process /usr/bin/dpkg returned an error code (1) 

然后它会中止安装。 我已经在我的另一台机器上安装了pure-ftpd就好了。

预备步骤

清理你的软件包并更新caching:

 sudo apt-get purge pure-ftpd sudo apt-get autoremove sudo apt-get autoclean sudo apt-get update 

然后再试一次:

 sudo apt-get install pure-ftpd 

如果重新安装PureFtpd不起作用

这是/usr/sbin/pure-ftpd-wrapper 第23行

 use File::Basename; 

File :: Basename是一个Perl模块。 我试着用下面的方法安装它

 $ cpan cpan[1]> install File::Basename 

但是安装失败的错误:

使得返回状态不好,安装似乎不可能

但是 ,它确实提到了File::Basenameperl-5.18.2发行版的一部分。
所以我升级了Perl:

 sudo apt-get upgrade perl --no-install-recommends 

之后,我可以validation它是安装使用:

 $ cpan cpan[1]> i File::Basename 

如果你不能安装Perl模块

问题:当你使用cpan并inputi File::Basename ,会出现什么情况?

响应:

autouse.pm在/usr/share/perl/5.14/App/Cpan.pm第182行没有返回真值。BEGIN失败 – 编译在/usr/share/perl/5.14/App/Cpan.pm第182行中止在/ usr / bin / cpan第8行编译失败。BEGIN失败 – 编译在/ usr / bin / cpan第8行中止。

下一步:

重新安装perl

 sudo apt-get install Perl --reinstall 

要么

 sudo apt-get purge Perl sudo apt-get install Perl 

(警告:清除Perl会影响很多依赖和其他应用程序)