zoukankan      html  css  js  c++  java
  • dpkg和perl的依赖环境出现错误故障解决(磁盘原因)

    内核:

    uname -a

    Linux localhost.localdomain 3.4.29-t4 #12 Wed Mar 13 16:50:15 EST 2013 armv7l armv7l armv7l GNU/Linux

    dpkg安装应用时遇到问题,提示运行apt-get -f install修复依赖。

    apt-get -f install 后提示如下:

    debconf: Perl may be unconfigured (Can't locate Debconf/Log.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at (eval 1) line 4.
    BEGIN failed--compilation aborted at (eval 1) line 4.

    从上面信息看@INC本身并没有什么变化。

    既然不能找到Debconf/Log.pm,就安装一下看看,结果perl -MCPAN -e shell “install Debconf::Log” 也出现错误。那到底问题在哪呢?

    忽然想起前些天曾在CPAN更新新版perl过程中出现网络中断安装失败,之后又删除了更新半截的~/perl5目录。难道是perl 被错误的switch到一个不存在的路径了?回看了一下@INC并没有我那天删除的那个安装目录。于是想~干脆新装一个perl试试。(最终结果证实这段尝试是一段弯路,不需要安装新版本的朋友可以跳过这段标记=cut......cut的部分)

    =cut

    安装新的perl,又不想费掉原来的环境,那就做版本共存吧。
    实现多个perl版本共存最好的工具是perlbrew,具体操作步骤在我的另外一篇日志里有提到,有不了解perlbrew的朋友,具体可访问http://blog.asiulo.com/post-9.html.

    这个安装时间会比较的长,但不需要值守。

    装好后记得看下log,没有问题再做switch。具体可参考http://blog.asiulo.com/post-9.html中的流程。

    继续之前的apt-get -f install,问题依旧,这个实验倒是证明了我的猜想,既不是版本发生switch的问题,那问题会在哪里呢?

    还是仔细再检查下原来的perl环境吧,于是乎执行下列操作切换回旧版perl

    source /opt/perl5/perlbrew/etc/bashrc

    perlbrew switch-off

    cut

    perl -V 重新查看perl的详细信息,还是没有发现什么问题。最后我开始把注意力放到了perl的@INC环境变量上。

    我开始ls查看他们,

    perl -e 'print join " ",@INC'|awk '{print "ls -l",$0}'|sh

    在/usr/share/perl5/发现了问题:

    ls: cannot access /usr/share/perl5/Algorithm: Input/output error
    ls: cannot access /usr/share/perl5/Net: Input/output error
    ls: cannot access /usr/share/perl5/Text: Input/output error
    ls: cannot access /usr/share/perl5/Time: Input/output error
    ls: cannot access /usr/share/perl5/Debconf: Input/output error
    ls: cannot access /usr/share/perl5/Date: Input/output error
    ls: cannot access /usr/share/perl5/Debian: Input/output error
    ls: cannot access /usr/share/perl5/HTML: Input/output error
    ls: cannot access /usr/share/perl5/Class: Input/output error
    ls: cannot access /usr/share/perl5/Bundle: Input/output error
    ls: cannot access /usr/share/perl5/Git: Input/output error
    ls: cannot access /usr/share/perl5/Error: Input/output error

    原来是磁盘出现了问题!

    dmesg查看了一下系统信息,也发现了nand flash提示CRC校验错误(我把/usr mount到这里了)。

    由于是实验环境,以及时间的关系,我最终没有进行fsck.ext4的检查与修复,而是重做了系统,把出现过错误的那块磁盘挂成了备盘。

    至此结案!

    本文系作者原创,转载请注明出处。如您阅读的是转载,请最好再看下原文,原文随时会更新和勘误的。

    @Gordon_chang
    1997年毕业于北京联合大学,先后在中国万网,新媒传信,亚信等公司工作,现在在一家创业型公司担任云计算与大数据运维方面的 PM & Engineer。 专注于以下四个领域: 分布式存储 分布式数据库 云计算 大数据 重点通过技术架构与性能优化(底层)实现基于私有云的大数据平台能力

  • 相关阅读:
    (转)expfilt 命令
    (转)第二十三节 inotify事件监控工具
    数据结构之平衡二叉树(AVL)
    安装apache2.4.10
    centos下编译安装mysql5.6
    随机 I/O & 顺序 I/O
    什么是mysql中的元数据
    linux中mail函数不能发送邮件怎么办
    检测MYSQL不同步发邮件通知的脚本
    mysql自动备份策略
  • 原文地址:https://www.cnblogs.com/gordonchang/p/6681559.html
Copyright © 2011-2022 走看看