zoukankan      html  css  js  c++  java
  • Linux

    01 - 05

    01 - apt-get命令执行异常,导致资源被锁不可用

    报错信息如下:

    E: 无法获得锁 /var/lib/dpkg/lock - open (11: 资源暂时不可用)
    E: 无法锁定管理目录(/var/lib/dpkg/),是否有其他进程正占用它?
    

    通过删除锁定文件来完成解锁:

    # rm -rf /var/cache/apt/archives/lock
    # rm -rf /var/lib/dpkg/lock
    

    解决非正常关闭apt-get的锁

    02 - sonar is not in the sudoers file. This incident will be reported.

    处理方法:将用户添加到sudo组

    [root@node201 ~]# visudo
    [root@node201 ~]# cat /etc/sudoers |grep "sonar"
    sonar    ALL=(ALL)   ALL
    [root@node201 ~]# 
    

    03 - Linux文件已经被删除,但还是可以被locate出来

    locate命令不是直接在目录中找寻文件,而是通过缓存(包含了被删除文件的信息)来查找。
    虽然删除了文件,但缓存中还有文件的相关信息,所以locate出来仍然有结果。将Server重启后,缓存被更新,就不会找到了。

    04 - Existing lock /var/run/yum.pid: another copy is running as pid

    [root@anliven ~]#  yum remove git
    Loaded plugins: fastestmirror, langpacks
    Existing lock /var/run/yum.pid: another copy is running as pid 3501.
    Another app is currently holding the yum lock; waiting for it to exit...
      The other application is: PackageKit
        Memory : 107 M RSS (873 MB VSZ)
        Started: Tue Jun  9 21:23:41 2020 - 01:21 ago
        State  : Sleeping, pid: 3501
    

    yum只能支持一个例程运行,所以如果有一个例程已经在运行,其他的必须等待该进程退出释放lock。
    出现这种情况时,可以用以下命令来恢复:
    rm -f /var/run/yum.pid

    05 - Ubuntu每次启动都显示System program problem detected


    解决办法
    sudo vim /etc/default/apport 将enabled=1改为enabled=0保存退出即可
    或者
    sudo rm -rf /var/crash/*

    06 - 10

  • 相关阅读:
    如何更改SQL Server2008默认数据库的存储路径
    虚拟内存页面文件pagefile.sys(棉文件)改变存放位置
    Redis热点数据高频访问问题以及解决方案
    gc日志收集和分析
    oauth2中client_id_to_access数据膨胀问题
    Redis慢查询日志
    24个Jvm面试题总结及答案
    springboot-使用assembly进行项目打包
    volatile关键字解读
    redis的zset结构跳表
  • 原文地址:https://www.cnblogs.com/anliven/p/6107525.html
Copyright © 2011-2022 走看看