Jos*_*L-S 45 package-management apt dependencies curl php7
我无法使用`curl 从网络获取内容。我尝试安装它并得到以下输出:
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) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)
我已经用sudo apt-mark showheld
和检查了保留的包裹dpkg -l | grep ^h
,但我没有得到任何结果。
此外,当我尝试安装时libcurl4
,它几乎破坏了我的系统,因为它试图删除这些包:
libcurl3 mongodb-enterprise mongodb-enterprise-server mongodb-enterprise-tools msodbcsql msodbcsql17 mssql-tools php7.1-curl r-base r-base-core
r-base-dev r-base-html r-cran-boot r-cran-class r-cran-codetools r-cran-foreign r-cran-getopt r-cran-kernsmooth r-cran-lattice r-cran-littler
r-cran-mass r-cran-matrix r-cran-mgcv r-cran-nlme r-cran-nnet r-cran-rpart r-cran-spatial r-cran-survival r-recommended slack-desktop
virtualbox-5.2
Run Code Online (Sandbox Code Playgroud)
编辑
这是输出cat /etc/apt/sources.list
:
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution. deb http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted deb-src
http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution. deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates main restricted deb-src
http://gb.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team. deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe deb-src
http://gb.archive.ubuntu.com/ubuntu/ bionic universe
deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates universe
deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team. deb http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic
multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu bionic partner deb-src
http://archive.canonical.com/ubuntu bionic partner
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb-src http://security.ubuntu.com/ubuntu bionic-security main
restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe deb-src
http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
deb http://gb.archive.ubuntu.com/ubuntu/ bionic-proposed main
multiverse universe restricted #Not for humans during development
stage of release bionic
# ded-src http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted ui=niverse
deb http://gb.archive.ubuntu.com/ubuntu/ bionic-backports main
restricted multiverse universe
Run Code Online (Sandbox Code Playgroud)
cos*_*bur 43
这个问题在 ubuntu 最近的 LTS 中的多个包中很常见。预安装的包在版本约定中可能存在错误,因为“18.04”和其他引用 repo 的字符串被视为包版本的一部分,而不是对 repo 的引用。
解决方法是卸载预安装的依赖项,然后重新安装。之后,您可以安装 cURL。
apt remove -y libcurl4
apt install -y libcurl4 curl
Run Code Online (Sandbox Code Playgroud)
其他有这个问题的包是 okular 和 libsdl2,解决方案是一样的,跟踪有问题的依赖项,删除并重新安装。
此外,您可以使用apt
降级机制(因此,不需要卸载依赖于 libcurl4 的软件包)。
apt install -y libcurl4=7.58.0-2ubuntu3
apt install -y curl
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
56655 次 |
最近记录: |