zoukankan      html  css  js  c++  java
  • ubuntu解决依赖未安装的问题

    今天在使用

    sudo apt-get install ccache

    命令安装ccache时报出了一个错误:

    liuru@liuru-ThinkPad-Edge-E540:~$ sudo apt-get install ccache
    正在读取软件包列表... 完成
    正在分析软件包的依赖关系树       
    正在读取状态信息... 完成       
    您可能需要运行“apt-get -f install”来纠正下列错误:
    下列软件包有未满足的依赖关系:
     linux-image-extra-4.4.0-101-generic : 依赖: linux-image-4.4.0-101-generic 但是它将不会被安装
     linux-image-extra-4.4.0-87-generic : 依赖: linux-image-4.4.0-87-generic 但是它将不会被安装
     linux-image-generic : 依赖: linux-image-4.4.0-101-generic 但是它将不会被安装
    E: 有未能满足的依赖关系。请尝试不指明软件包的名字来运行“apt-get -f install”(也可以指定一个解决办法)。

    刚开始时没有想到是因为内核的版本过多的原因,并且使用它的提示

    apt-get -f install

    也是同样没有得到任何的有用的改变,还以为是我的apt-get 有问题了,所以才会出现这样的问题,使用了如下的命令

    sudo apt-get update

    同样是有错,错误信息如下:

    W: 校验数字签名时出错。此仓库未被更新,所以仍然使用此前的索引文件。GPG 错误:http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 Release: 下列签名无效: KEYEXPIRED 1507497109
    W: 仓库 “http://ppa.launchpad.net/vokoscreen-dev/vokoscreen/ubuntu xenial Release” 没有 Release 文件。
    N: 无法认证来自该源的数据,所以使用它会带来潜在风险。
    N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
    W: 无法下载 http://repo.mongodb.org/apt/ubuntu/dists/xenial/mongodb-org/3.2/Release.gpg  下列签名无效: KEYEXPIRED 1507497109
    E: 无法下载 http://ppa.launchpad.net/vokoscreen-dev/vokoscreen/ubuntu/dists/xenial/main/binary-amd64/Packages  403  Forbidden
    W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

    后来我就强制安装了它的未安装的依赖,但是出现了磁盘写满了的错误,/boot的分区内存不够的问题,后来查了一下说是有多余的内核、旧的版本,需要使用下面的命令查看一下:

     dpkg --get-selections |grep linux-image
    liuru@liuru-ThinkPad-Edge-E540:~$ dpkg --get-selections | grep linux-image
    linux-image-4.4.0-38-generic            deinstall
    linux-image-4.4.0-47-generic            deinstall
    linux-image-4.4.0-51-generic            deinstall
    linux-image-4.4.0-53-generic            deinstall
    linux-image-4.4.0-64-generic            install
    linux-image-4.4.0-66-generic            install
    linux-image-4.4.0-71-generic            install
    linux-image-4.4.0-72-generic            install
    linux-image-4.4.0-75-generic            install
    linux-image-4.4.0-78-generic            install
    linux-image-4.4.0-79-generic            install
    linux-image-4.4.0-81-generic            install
    linux-image-4.4.0-83-generic            install
    linux-image-extra-4.4.0-101-generic        install
    linux-image-extra-4.4.0-38-generic        deinstall
    linux-image-extra-4.4.0-47-generic        deinstall
    linux-image-extra-4.4.0-51-generic        deinstall
    linux-image-extra-4.4.0-53-generic        deinstall
    linux-image-extra-4.4.0-64-generic        install
    linux-image-extra-4.4.0-66-generic        install
    linux-image-extra-4.4.0-71-generic        install
    linux-image-extra-4.4.0-72-generic        install
    linux-image-extra-4.4.0-75-generic        install
    linux-image-extra-4.4.0-78-generic        install
    linux-image-extra-4.4.0-79-generic        install
    linux-image-extra-4.4.0-81-generic        install
    linux-image-extra-4.4.0-83-generic        install
    linux-image-extra-4.4.0-87-generic        install
    linux-image-generic                install

    而我使用了uname -a 查看了我正在使用的内核版本是哪个

    Linux liuru-ThinkPad-Edge-E540 4.4.0-83-generic #106-Ubuntu SMP Mon Jun 26 17:54:43 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

    如上可以看出我正在使用的是83,所以其他的我便可以删除,清理一些/boot的空间.

    于是我便使用了

     sudo apt-get autoremove linux-image-4.4.0-31-generic linux-image-4.4.0-34-generic 

    命令打算删除了多余的内核,但是又报错了,因为,我的内核版本中有一个以上的内核依赖缺失,于是乎,尝试了另外一种方法,并且autoremove 和remove  purge 都行不通。但是前两种的原因是不能清理彻底,后面的可以清除干净

    但是还可以通过下面的命令直接清除干净

    sudo dpkg -P linux-image-4.4.0-71-generic linux-image-extra-4.4.0-71-generic  linux-image-4.4.0-72-generic linux-image-extra-4.4.0-72-generic

    删除deinstall类型的内核时,同样使用上面的方法。

  • 相关阅读:
    字符串替换
    字符串查找
    字符串比较
    字节与字符串相互转换
    1365. How Many Numbers Are Smaller Than the Current Number
    1486. XOR Operation in an Array
    1431. Kids With the Greatest Number of Candies
    1470. Shuffle the Array
    1480. Running Sum of 1d Array
    【STM32H7教程】第56章 STM32H7的DMA2D应用之刷色块,位图和Alpha混合
  • 原文地址:https://www.cnblogs.com/future-liu1121/p/7900217.html
Copyright © 2011-2022 走看看