首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何同时安装curl (取决于libcurl4)和mongodb (取决于libcurl3)?

如何同时安装curl (取决于libcurl4)和mongodb (取决于libcurl3)?
EN

Ask Ubuntu用户
提问于 2018-08-06 21:02:38
回答 1查看 5.6K关注 0票数 1

在Lubuntu18.04上,我通过以下https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition安装了mongodb

代码语言:javascript
复制
sudo apt install -y mongodb-org mongodb-org-server libcurl3

现在想要安装curl

代码语言:javascript
复制
$ sudo apt install 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.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我跟着https://askubuntu.com/a/1051988/1471

您可以使用apt降级机制(因此,不需要卸载依赖于libcurl4的包)。apt安装-y libcurl4 4=7.58.0-2 ubuntu3 apt安装-y curl

但是后来libcurl3和mongodb被删除了

代码语言:javascript
复制
$ sudo apt install -y libcurl4=7.58.0-2ubuntu3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  calibre-bin fonts-mathjax geoclue-2.0 iio-sensor-proxy libbrotli1 libchm1 libgeoclue-2-0 libjs-coffeescript libjs-mathjax libpodofo0.9.5 libqt5designer5 libqt5help5
  libqt5positioning5 libqt5sensors5 libqt5sql5 libqt5sql5-sqlite libqt5test5 libqt5webchannel5 libqt5webkit5 libqt5xml5 libwoff1 mongodb-org-mongos mongodb-org-shell
  mongodb-org-tools python-apsw python-asn1crypto python-bs4 python-cffi-backend python-chardet python-cherrypy3 python-cryptography python-cssselect python-cssutils
  python-dateutil python-dbus python-dnspython python-enum34 python-feedparser python-html5-parser python-html5lib python-idna python-ipaddress python-libxml2 python-lxml
  python-markdown python-mechanize python-msgpack python-netifaces python-olefile python-openssl python-pil python-pygments python-pyparsing python-pyqt5 python-pyqt5.qtsvg
  python-pyqt5.qtwebkit python-regex python-repoze.lru python-routes python-simplejson python-sip python-six python-utidylib python-webencodings python-webob python-yaml
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  libcurl3 mongodb-org mongodb-org-server
The following NEW packages will be installed:
  libcurl4
0 upgraded, 1 newly installed, 3 to remove and 0 not upgraded.
Need to get 214 kB of archives.
After this operation, 61.6 MB disk space will be freed.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 libcurl4 amd64 7.58.0-2ubuntu3 [214 kB]
Fetched 214 kB in 1s (419 kB/s)
(Reading database ... 235089 files and directories currently installed.)
Removing mongodb-org (4.0.0) ...
Removing mongodb-org-server (4.0.0) ...
Removing libcurl3:amd64 (7.58.0-2ubuntu2) ...
Selecting previously unselected package libcurl4:amd64.
(Reading database ... 235068 files and directories currently installed.)
Preparing to unpack .../libcurl4_7.58.0-2ubuntu3_amd64.deb ...
Unpacking libcurl4:amd64 (7.58.0-2ubuntu3) ...
Setting up libcurl4:amd64 (7.58.0-2ubuntu3) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...

当我试图安装mongodb时,libcurl4将被删除

代码语言:javascript
复制
$ sudo apt install -y mongodb-org mongodb-org-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  calibre-bin fonts-mathjax geoclue-2.0 iio-sensor-proxy libbrotli1 libchm1 libgeoclue-2-0 libjs-coffeescript libjs-mathjax libpodofo0.9.5 libqt5designer5 libqt5help5
  libqt5positioning5 libqt5sensors5 libqt5sql5 libqt5sql5-sqlite libqt5test5 libqt5webchannel5 libqt5webkit5 libqt5xml5 libwoff1 python-apsw python-asn1crypto python-bs4
  python-cffi-backend python-chardet python-cherrypy3 python-cryptography python-cssselect python-cssutils python-dateutil python-dbus python-dnspython python-enum34
  python-feedparser python-html5-parser python-html5lib python-idna python-ipaddress python-libxml2 python-lxml python-markdown python-mechanize python-msgpack python-netifaces
  python-olefile python-openssl python-pil python-pygments python-pyparsing python-pyqt5 python-pyqt5.qtsvg python-pyqt5.qtwebkit python-regex python-repoze.lru python-routes
  python-simplejson python-sip python-six python-utidylib python-webencodings python-webob python-yaml
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libcurl3
The following packages will be REMOVED:
  libcurl4
The following NEW packages will be installed:
  libcurl3 mongodb-org mongodb-org-server
0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
Need to get 15.7 MB of archives.
After this operation, 61.6 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 libcurl3 amd64 7.58.0-2ubuntu2 [214 kB]
Get:2 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0/multiverse amd64 mongodb-org-server amd64 4.0.0 [15.5 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0/multiverse amd64 mongodb-org amd64 4.0.0 [3,518 B]                                                              
Fetched 15.7 MB in 25s (639 kB/s)                                                                                                                                                
(Reading database ... 235073 files and directories currently installed.)
Removing libcurl4:amd64 (7.58.0-2ubuntu3) ...
Selecting previously unselected package libcurl3:amd64.
(Reading database ... 235068 files and directories currently installed.)
Preparing to unpack .../libcurl3_7.58.0-2ubuntu2_amd64.deb ...
Unpacking libcurl3:amd64 (7.58.0-2ubuntu2) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../mongodb-org-server_4.0.0_amd64.deb ...
Unpacking mongodb-org-server (4.0.0) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../mongodb-org_4.0.0_amd64.deb ...
Unpacking mongodb-org (4.0.0) ...
Setting up libcurl3:amd64 (7.58.0-2ubuntu2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up mongodb-org-server (4.0.0) ...
Setting up mongodb-org (4.0.0) ...

我该如何安装curl和mongodb?

EN

回答 1

Ask Ubuntu用户

发布于 2019-07-18 08:46:06

解决库依赖问题的另一种方法是使用docker容器。

例如,在这种情况下,一旦安装了docker-ce,您就可以运行如下内容:

代码语言:javascript
复制
docker run -d --name mongo-4.0.9  -p 127.0.0.1:27017:27017  --restart unless-stopped -v /var/lib/mongodb:/data/db mongo:4.0.9 

这样,您就不依赖于系统依赖项。

希望这能有所帮助。

票数 -1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1063003

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档