通过apt-get install -y mongodb 出现如下报错。
Get:23 http://cn.archive.ubuntu.com/ubuntu/ trusty/universe mongodb i386 1:2.4.9-1ubuntu2 [5,124 B]
Fetched 7,320 kB in 50min 37s (2,410 B/s)
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/libv/libv8-3.14/libv8-3.14.5_3.14.5.8-5ubuntu2_i386.deb Connection failed [IP: 91.189.91.26 80]
E: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/m/mongodb/mongodb-clients_2.4.9-1ubuntu2_i386.deb Connection failed [IP: 91.189.91.26 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
解决方法:
1、 sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
然后将里面原来的被人注视掉。
然后添加新的deb源。这里是我的版本是14.04的版本
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiver
相信的deb源参见https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/。
添加完之后apt-get update
再次执行安装命令sudo apt-get install -y mongodb
仅供参考