我正在尝试从 mongodb 3.2.10 升级到 3.4.4。这是在我用于开发的 c9.io 环境中进行的,升级似乎在生产服务器上有效。
它似乎已经进行了列表升级,但是当尝试下载并应用升级时,它最终出现了相同的错误。
user:~/workspace (master) $ sudo apt-get update && sudo apt-get upgrade
Ign:1 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 InRelease
Hit:2 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 Release
Hit:3 http://security.ubuntu.com/ubuntu trusty-security InRelease
Ign:5 http://us-central1.gce.clouds.archive.ubuntu.com/ubuntu trusty InRelease
Hit:6 http://us-central1.gce.clouds.archive.ubuntu.com/ubuntu trusty-updates InRelease
Hit:7 http://us-central1.gce.clouds.archive.ubuntu.com/ubuntu trusty-backports InRelease
Hit:8 http://us-central1.gce.clouds.archive.ubuntu.com/ubuntu trusty Release
Reading package lists... Done
WARNING: Running upgrade on your Cloud 9 instance will use your disk quota for package upgrades.
Each time a new workspace is created it is using very recent packages already, try just installing
the packages you require first.
Press Y to continue anyway
y
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
我已经运行sudo dpkg --configure -a
(很多次)并且刷新了服务器,但是下次尝试时仍然会给我同样的错误。
答案1
尝试删除 /var/lib/dpkg/updates 目录中的所有文件,
cd /var/lib/dpkg/updates
sudo rm *
然后运行
sudo apt-get update