【问题标题】:Error while installing mongodb on ubuntu 16.04在 ubuntu 16.04 上安装 mongodb 时出错
【发布时间】:2017-09-25 11:54:53
【问题描述】:

我已经看过这些答案,所以请不要在解决方案中链接它们:

Installing MongoDB on Ubuntu 16.04 https://unix.stackexchange.com/questions/220467/mongodb-unmet-dependencies/220483 can't install mongodb on ubuntu 16.10 https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04

我已经为 ubuntu 16.04 添加了所需的存储库

当我运行sudo apt-get install -y mongodb-org 时,它会抛出错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-4.4.0-93-generic : Depends: linux-headers-4.4.0-93 but it is not going to be installed
mongodb-org : Depends: mongodb-org-shell but it is not going to be installed
               Depends: mongodb-org-server but it is not going to be installed
               Depends: mongodb-org-mongos but it is not going to be installed
               Depends: mongodb-org-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

在运行 apt-get -f install 时,我收到以下错误:

Unpacking linux-headers-4.4.0-93 (4.4.0-93.116) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-4.4.0-93_4.4.0-93.116_all.deb (--unpack):
unable to create '/usr/src/linux-headers-4.4.0-93/arch/xtensa/include/asm/pgtable.h.dpkg-new' (while processing './usr/src/linux-headers-4.4.0-93/arch/xtensa/include/asm/pgtable.h'): No space left on device
No apport report written because the error message indicates a disk full error
                                                                          dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-4.4.0-93_4.4.0-93.116_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

当我再次尝试安装时,同样的事情仍在继续。

谁能解释一下这个错误是什么以及如何安装它?

更新:

运行df -h 给出:

Filesystem      Size  Used Avail Use% Mounted on
udev            487M     0  487M   0% /dev
tmpfs           100M   12M   88M  12% /run
/dev/xvda1      7.8G  5.3G  2.1G  72% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/1000

运行df -i 给出:

Filesystem     Inodes  IUsed  IFree IUse% Mounted on
udev           124466    360 124106    1% /dev
tmpfs          126788    480 126308    1% /run
/dev/xvda1     524288 520744   3544  100% /
tmpfs          126788      1 126787    1% /dev/shm
tmpfs          126788      6 126782    1% /run/lock
tmpfs          126788     16 126772    1% /sys/fs/cgroup
tmpfs          126794      4 126790    1% /run/user/1000

【问题讨论】:

  • 有什么进展吗? @mrid
  • 你找到解决方案了吗?
  • @Gorgon_Union 我重新安装了几次,它才开始工作。奇怪

标签: linux mongodb ubuntu ubuntu-16.04


【解决方案1】:

安装libcurl3后工作

sudo apt install libcurl3

【讨论】:

    【解决方案2】:

    我也有类似的问题,通过这样做为我解决了 进入这个目录/etc/apt/sources.list.d/,看看有没有其他的mongodb-org-*.list文件,会引起冲突。

    然后尝试再次安装,如果再次出现问题,则运行

    sudo apt purge mongod* sudo apt purge mongodb* sudo apt purge mongodb-org*

    删除任何不一致,然后转到https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ 并按照程序操作。

    如果您是某种 Ubuntu 衍生产品,如 Linux Mint、Ubuntu GNOME 等,请确保在粘贴所需命令之前,在 wiki 上的 ubuntu 衍生版本上运行的是哪个 Ubuntu 版本。 就我而言,我使用的是 Linux Mint 17 -> Ubuntu 14.04,并且我正在使用 Ubuntu 16.04 进行安装,导致冲突

    希望这能解决问题。

    【讨论】:

    • 清除有帮助!
    【解决方案3】:

    你更新了吗?

    sudo apt-get update && sudo apt-get upgrade
    

    如果更新没有帮助,请尝试检查损坏的依赖项:

    sudo apt-get check
    

    检查命令是一种诊断工具。它用于更新包缓存并检查损坏的依赖项。

    我还会尝试另外两件事。 首先,

    sudo dpkg --configure -a
    sudo apt-get -f install
    

    如果这没有帮助,请尝试解除对 dpkg 的阻止

    sudo rm -rf /var/lib/apt/lists/partial/*
    sudo apt-get -f install
    

    希望对你有帮助。

    【讨论】:

    • 上面写着You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: linux-headers-4.4.0-93-generic : Depends: linux-headers-4.4.0-93 but it is not installed
    • 抱歉,我不得不问一个显而易见的问题——你的设备上有足够的空间吗?因为它确实说:设备上没有剩余空间没有写入报告报告,因为错误消息表明磁盘已满错误
    • 升级给出了同样的错误。检查更新的问题。我已经添加了df -h 命令的结果。
    • 我已经更新了评论,还有两件事要尝试。
    【解决方案4】:
     sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
    
    echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
    
    sudo apt-get update
    sudo apt-get install -y mongodb-org
    sudo service mongod start
    mongo
    

    【讨论】:

      【解决方案5】:

      运行以下命令:

      sudo apt-get -f 安装

      然后尝试运行sudo apt-get install -y mongodb-org

      【讨论】:

        【解决方案6】:
        • 下载 MongoDB 社区服务器 (.dbz) 版本

        • 解压并移动到主目录

        • 通过运行编辑 ~/.profile:

          • gedit ~/.profile
        • 然后添加这个:

          • echo export PATH=mongodb-linux-x86_64-ubuntu1804-4.0.4/bin:$PATH
        • 保存然后通过运行更新系统变量:

          • source ~/.profile
        • 之后,通过运行启动服务器:

          • mongod

        【讨论】:

          【解决方案7】:

          我尝试了很多答案,但最后我发现make system version与mongo repo所需的版本不匹配。在 MongoDB 官方网站上,有一个选项可以让您选择正确的 repo 链接。 因此,首先检查您的系统版本:

          lsb_release -dc
          

          那如果你的系统版本是18.04,试试

          echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
          

          如果你的系统版本是16.04,试试

          echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
          

          【讨论】:

          • 黄色文本框用于错误等。使用... 指出要执行的代码。使用要执行的第一个脚本代码查看我的修改。现在它让我们感到困惑。 (来自评论)。
          【解决方案8】:

          我也面临同样的问题。我尝试使用 brew 安装,但它对我不起作用。我按照官网上提到的所有步骤进行操作,但没有成功。

          我为 MongoDB 创建了一个特定的 sources.list 文件并添加到 apt 始终使用的 sources.list 目录中。确保使用与 sources.list 相同的格式

          echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
          

          接下来,我们需要更新以使 apt 使用更新后的 sources.list。所以我使用了更新命令。

          sudo apt-get update
          

          最后,我执行了安装命令,它成功了。

          【讨论】:

            【解决方案9】:

            您检查过服务器上的 inode 吗? df -h 可能仍显示剩余空间,但您可能没有 inode。请尝试运行 df -i 并查看服务器上是否还有任何 inode。

            【讨论】:

            • 谢谢,我更新了我的问题并添加了df -i 的输出。你能查一下,如果有问题请告诉我:)
            【解决方案10】:

            用于在 ubuntu 16.04 中安装 mongodb 4.0

            
            echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
            
            sudo apt install libcurl3
            
            sudo apt-get update
            
            sudo service mongod start
            
            mongo
            

            【讨论】:

              【解决方案11】:

              使用此命令删除这些文件。

              sudo dpkg -i --force-overwrite /var/cache/apt/archives/mongodb-org-mongos_4.4.4_amd64.deb; sudo dpkg -i --force-overwrite /var/cache/apt/archives/mongodb-org-server_4.4.4_amd64.deb; sudo dpkg -i --force-overwrite /var/cache/apt/archives/mongodb-org-tools;
              

              然后运行

              sudo apt-get install -y mongodb-org;
              
              sudo systemctl start mongod;
              

              【讨论】:

                猜你喜欢
                • 2016-12-08
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 2017-05-12
                • 2020-01-16
                • 2018-08-25
                • 1970-01-01
                • 1970-01-01
                相关资源
                最近更新 更多