Linux日常使用之软件安装失败的处理方式

从古董系统Ubuntu12.04一路升级到较新的16.04,发现有些软件,如samba,不能用了。用一般的处理方式如apt -f install也没办法处理。一直放着,今天还是觉得samba有一些方便,便花了一点时间去看这个问题。错误详情➜ ~ sudo apt install sambaReadi

从古董系统Ubuntu12.04一路升级到较新的16.04,发现有些软件,如samba,不能用了。用一般的处理方式如apt -f install也没办法处理。一直放着,今天还是觉得samba有一些方便,便花了一点时间去看这个问题。

错误详情

➜  ~ sudo apt install samba

Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: samba : Depends: python-samba but it is not going to be installed Depends: samba-common (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed Depends: samba-common-bin (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed Depends: libwbclient0 (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed Depends: samba-libs (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed Recommends: attr Recommends: samba-dsdb-modules but it is not going to be installed Recommends: samba-vfs-modules but it is not going to be installed E: Unable to correct problems, you have held broken packages.

原因

我觉得大致如下: 提示是packages have unmet dependencies,再仔细看一下下面的描述,这种问题其实就是软件所依赖的包的版本不对,基本一可以通过sudo apt -f install解决,但是该包被以为是最新的,无法被替换掉。

解决办法

先把这些依赖包全部卸载掉,然后再安装回来。

过程如下:

➜  ~ sudo apt install python-samba

Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: python-samba : Depends: samba-libs (= 2:4.3.8+dfsg-0ubuntu1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

➜  ~ sudo apt install samba-libs

Reading package lists... Done Building dependency tree
Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: samba-libs : Depends: libwbclient0 (= 2:4.3.8+dfsg-0ubuntu1) but 2:4.3.11+dfsg-0ubuntu0.14.04.11 is to be installed E: Unable to correct problems, you have held broken packages.

➜  ~ sudo apt install libwbclient0

Reading package lists... Done Building dependency tree
Reading state information... Done libwbclient0 is already the newest version (2:4.3.11+dfsg-0ubuntu0.14.04.11). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

➜  ~ sudo apt remove libwbclient0:amd64

Reading package lists... Done Building dependency tree
Reading state information... Done The following packages will be REMOVED: libwbclient0 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 209 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 318410 files and directories currently installed.) Removing libwbclient0:amd64 (2:4.3.11+dfsg-0ubuntu0.14.04.11) ... Processing triggers for libc-bin (2.23-0ubuntu3) ...

➜  ~ sudo apt install libwbclient0

Reading package lists... Done Building dependency tree
Reading state information... Done The following NEW packages will be installed: libwbclient0 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 30.4 kB of archives. After this operation, 186 kB of additional disk space will be used. Get:1 http://mirrors.aliyun.com/ubuntu xenial/main amd64 libwbclient0 amd64 2:4.3.8+dfsg-0ubuntu1 [30.4 kB] Fetched 30.4 kB in 0s (146 kB/s)
Selecting previously unselected package libwbclient0:amd64. (Reading database ... 318404 files and directories currently installed.) Preparing to unpack .../libwbclient0_2%3a4.3.8+dfsg-0ubuntu1_amd64.deb ... Unpacking libwbclient0:amd64 (2:4.3.8+dfsg-0ubuntu1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ... Setting up libwbclient0:amd64 (2:4.3.8+dfsg-0ubuntu1) ... Processing triggers for libc-bin (2.23-0ubuntu3) ...

➜  ~ sudo apt install libwbclient0

Reading package lists... Done Building dependency tree
Reading state information... Done libwbclient0 is already the newest version (2:4.3.8+dfsg-0ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

其它的依赖包按照此方法去一一操作,操作完成了之后便可以安装好之前想安装的软件了。

Read more

Volcano 与 Kubernetes GPU 调度学习笔记

本笔记系统整理 Volcano 调度器、Kubernetes 调度框架、GPU Device Plugin、HAMi 等云原生 AI 调度领域的核心知识,适合用于学习、复习和工程实践参考。 目录 * 第一部分:Volcano 入门 * 1. Volcano 是什么 * 2. 安装与快速使用 * 3. 核心特性一览 * 第二部分:Volcano 整体架构 * 4. Volcano 解决的核心问题 * 5. 整体架构与数据流 * 6. 三层抽象模型 * 第三部分:Volcano 核心实现原理 * 7. Session 机制 * 8. Gang Scheduling 实现 * 9. Queue 与 DRF 公平调度

容器镜像(4):镜像的常用工具箱

容器镜像(4):镜像的常用工具箱

前几篇在讲多架构镜像时已经用过 skopeo 和 crane 做镜像复制,这篇系统整理这两个工具的完整能力,同时介绍几个日常操作镜像时同样好用的工具。 一、skopeo:不依赖 Daemon 的镜像瑞士军刀 skopeo 的核心价值是绕过 Docker daemon,直接与 Registry API 交互。上一篇用它做镜像复制和离线传输,但它的能力远不止于此。 1.1 安装 # Ubuntu / Debian sudo apt install -y skopeo skopeo --version # skopeo version 1.15.1 1.2 inspect:免拉取检查镜像元数据 docker inspect 需要先把镜像拉到本地,skopeo inspect 直接向 Registry

容器镜像(3):多架构镜像构建

容器镜像(3):多架构镜像构建

一、什么是多架构镜像 1.1 OCI Image Index 上一篇介绍了单平台镜像的结构:一个 Manifest 指向 Config 和若干 Layer blob。多架构镜像在此之上多了一层——OCI Image Index(也叫 Manifest List),是一个轻量的索引文件,把多个单平台 Manifest 组织在一起: $ docker manifest inspect golang:1.22-alpine { "schemaVersion": 2, "mediaType": "application/vnd.oci.image.index.v1+json", "manifests&

容器镜像(2):containerd 视角下的镜像

容器镜像(2):containerd 视角下的镜像

一、为什么需要了解 containerd 如果你只用 docker run 跑容器,从来不关心底层,那可以不了解 containerd。但如果你在用 Kubernetes,或者想真正理解"容器运行时"是什么,containerd 是绕不开的。 事实上,当你执行 docker run 的时候,containerd 早就在后台悄悄工作了——Docker 从 1.11 版本开始,就把核心运行时剥离出来交给 containerd 负责。 1.1 Docker 的架构演变 早期的 Docker(1.10 及之前)是一个"大一统"的单体程序:一个 dockerd