添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

使用 apt-get install curl 命令安装 curl 失败,提示:

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:
 curl : Depends: libcurl4 (= 7.58.0-2ubuntu3.16) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

报错信息中有提到缺少依赖 libcurl4 ,所以使用 aptitude 命令查看为什么不能安装此依赖

首先安装 aptitude

apt-get install -y aptitude

使用命令查看不能安装的原因

aptitude why-not libcurl4
# 打印输出
i   libcurl3 Conflicts libcurl4

可知有两个版本冲突,所以卸载冲突的 package 即可

apt-get remove libcurl3
# 打印输出
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  mongodb-org-mongos mongodb-org-shell mongodb-org-tools
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3 mongodb-org mongodb-org-server
0 upgraded, 0 newly installed, 3 to remove and 86 not upgraded.
After this operation, 64.2 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 139019 files and directories currently installed.)
Removing mongodb-org (4.0.27) ...
Removing mongodb-org-server (4.0.27) ...
Removing libcurl3:amd64 (7.58.0-2ubuntu2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.2) ...

由输出可知,是 mongoDB 依赖 libcurl3,所以建议安装这些软件时,使用 docker 安装,是应用环境隔离

再次安装 curl 即可

apt-get install -y curl

方案2,使用 apt-get -f 命令

apt-get -f install = apt-get install -f 

是修复依赖关系(depends)的命令,就是假如你的系统上有某个package不满足依赖条件,这个命令就会自动修复,安装那个package依赖的package。

使用 apt-get install curl 命令安装 curl 失败,提示:Reading package lists... DoneBuilding dependency tree Reading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using 昨晚更新apt-get时由于太晚要睡觉,所以还没下载完就ctrl-c中断、关机了。今天重新更新时,报错如下 Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise-updates/restricted/binary-i386/Packages  Hash Sum mismatch 只能清空原来下载的内容,重新更新了 rm -rf /var/lib/apt/lists/* apt-get clean && sudo apt-get update 作者:coder_szc 1 问题描述   我按照此教程:为树莓派更换国内镜像源,更换树莓派镜像源为国内的 清华源 后,在使用 sudo apt-get install aptitude 时,出现依赖包错误的问题,具体错误信息如下: pi@raspberrypi:~ $ sudo apt-get install aptitude Reading package lists... Done Building dependency tree Reading. `liuhuan@liuhuan-G5-5587:~$ sudo apt install openssh-server 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 situati 依赖库版本问题引起的安装失败解决方法如下有两种: 1、是由于源需要更新,如下操作: libssl-dev : 依赖: libssl0.9.8 (= 0.9.8o-1ubuntu4) 但是 0.9.8o-1ubuntu4.4 正要被安装 解决方法 进入“系统->系统管理->更新管理器->设置”,在弹出的“软件源”对话框中选“更新”标签页,选中“Ubuntu 更新”...
云服务器Ubuntu实话配置 修改云镜像源 # deb cdrom:[Ubuntu 20.04.1 LTS _Focal Fossa_ - Release amd64 (20200731)]/ focal main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://mirrors.aliy
$ sudo apt-get install lm-sensors sensors-applet Reading package lists... Done Building dependency tree Reading state information... Done lm-sensors is already the newest version (1:3.3.4-2ubuntu1). Some packages could not be installed. This may mean root@root:-$sudo apt-get install vim 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 ...
这通常表示在您的系统上存在破损的软件包,导致无法安装或升级其他软件包。建议您使用系统包管理器或 apt-get 命令来修复这些问题。 sudo apt-get clean sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade sudo apt-get check sudo apt-get -f install sudo dpkg --configure -a 如果这些命令无法解决问题, 可以尝试用 "sudo apt-get install -f" 来强制安装.