遇到apt-get upgrade 失败并提示:
david@window:~$ sudo apt-get dist-upgrade
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:
clang-3.8 : Depends: libllvm3.8v4 but it is not installed
clang-format-3.8 : Depends: libllvm3.8v4 but it is not installed
libclang-common-3.8-dev : Depends: libllvm3.8v4 (= 1:3.8-2ubuntu3~trusty4) but it is not installed
libclang1-3.8 : Depends: libllvm3.8v4 but it is not installed
liblldb-3.8 : Depends: libllvm3.8v4 (= 1:3.8-2ubuntu3~trusty4) but it is not installed
lldb-3.8 : Depends: libllvm3.8v4 (= 1:3.8-2ubuntu3~trusty4) but it is not installed
llvm-3.8 : Depends: libllvm3.8v4 but it is not installed
llvm-3.8-dev : Depends: libllvm3.8v4 (= 1:3.8-2ubuntu3~trusty4) but it is not installed
llvm-3.8-runtime : Depends: libllvm3.8v4 but it is not installed
E: Unmet dependencies. Try using -f.
然后运行 apt-get -f install 时候,又提示:
david@window:~$ sudo apt-get dist-upgrade -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
Calculating upgrade... Done
The following NEW packages will be installed:
libllvm3.8v4
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
9 not fully installed or removed.
Need to get 9721 kB of archives.
After this operation, 40,4 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://si.archive.ubuntu.com/ubuntu/ trusty-updates/main libllvm3.8v4 amd64 1:3.8-2ubuntu3~trusty4 [9721 kB]
Fetched 9721 kB in 0s (19,8 MB/s)
(Reading database ... 427368 files and directories currently installed.)
Preparing to unpack .../libllvm3.8v4_1%3a3.8-2ubuntu3~trusty4_amd64.deb ...
Unpacking libllvm3.8v4:amd64 (1:3.8-2ubuntu3~trusty4) ...
dpkg: error processing archive /var/cache/apt/archives/libllvm3.8v4_1%3a3.8-2ubuntu3~trusty4_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libLLVM-3.8.so.1', which is also in package libllvm3.8:amd64 1:3.8~svn271772-1~exp1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libllvm3.8v4_1%3a3.8-2ubuntu3~trusty4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
重点来了:
运行:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libllvm3.8v4_1%3a3.8-2ubuntu3~trusty4_amd64.deb
然后再
apt-get -f install
sudo apt-get dist-upgrade