当我想安装像 gedit 这样的任何包时:
sudo apt-get clean
sudo apt-get autoclean
apt install gedit
输出是:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
gedit : Depends: libgspell-1-1 (>= 1.0.0) but it is not going to be installed
Depends: libgtksourceview-3.0-1 (>= 3.21.5) but it is not going to be installed
Depends: libpeas-1.0-0 (>= 1.14.1) but it is not going to be installed
Depends: gir1.2-gtk-3.0 but it is not going to be installed
Depends: gir1.2-gtksource-3.0 but it is not going to be installed
Depends: gedit-common (>= 3.22) but it is not going to be installed
当我们使用:
**apt --fix-broken install**
我们看:
dpkg: error processing archive /var/cache/apt/archives/libwinpr2-2_2.0.0~git20170725.1.1648deb+dfsg1-7~bpo9+1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libwinpr2.so.2.0.0', which is also in package libwinpr2:amd64 2.0.0~git201803141334-0+remmina201803141402.rf8baeb7.d29dd283~ubuntu18.04.1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/libwinpr2-2_2.0.0~git20170725.1.1648deb+dfsg1-7~bpo9+1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
或者当我使用这个命令时:
aptitude install
我看到此错误消息:
dpkg: dependency problems prevent configuration of libfreerdp2-2:amd64:
libfreerdp2-2:amd64 depends on libwinpr2-2 (>= 2.0.0~git20161130.1.e60d0d5+dfsg1); however:
Package libwinpr2-2:amd64 is not installed.
dpkg: error processing package libfreerdp2-2:amd64 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libfreerdp-client2-2:amd64:
libfreerdp-client2-2:amd64 depends on libfreerdp2-2 (>= 2.0.0~git20161130.1.e60d0d5+dfsg1); however:
Package libfreerdp2-2:amd64 is not configured yet.
libfreerdp-client2-2:amd64 depends on libwinpr2-2 (>= 2.0.0~git20170725.1.1648deb+dfsg1); however:
Package libwinpr2-2:amd64 is not installed.
dpkg: error processing package libfreerdp-client2-2:amd64 (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.24-11+deb9u1) ...
dpkg: dependency problems prevent configuration of remmina-plugin-rdp:amd64:
remmina-plugin-rdp:amd64 depends on libfreerdp-client2-2 (>= 2.0.0~git20160317.1.75ae3f5+dfsg1); however:
Package libfreerdp-client2-2:amd64 is not configured yet.
remmina-plugin-rdp:amd64 depends on libfreerdp2-2 (>= 2.0.0~git20160317.1.75ae3f5+dfsg1); however:
Package libfreerdp2-2:amd64 is not configured yet.
remmina-plugin-rdp:amd64 depends on libwinpr2-2 (>= 2.0.0~git20160317.1.75ae3f5+dfsg1); however:
Package libwinpr2-2:amd64 is not installed.
dpkg: error processing package remmina-plugin-rdp:amd64 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
**libfreerdp2-2:amd64
libfreerdp-client2-2:amd64
remmina-plugin-rdp:amd64**
例如:
sudo apt-get install remmina-plugin-rdp
输出是:
The following packages have unmet dependencies:
libfreerdp-client2-2 : Depends: libwinpr2-2 (>= 2.0.0~git20170725.1.1648deb+dfsg1) but it is not going to be installed
libfreerdp2-2 : Depends: libwinpr2-2 (>= 2.0.0~git20161130.1.e60d0d5+dfsg1) but it is not going to be installed
remmina-plugin-rdp : Depends: libwinpr2-2 (>= 2.0.0~git20160317.1.75ae3f5+dfsg1) but it is not going to be installed
E: Unmet dependencies. Try '**apt --fix-broken install**' with no packages (or specify a solution).
和
apt-cache policy
输出是:
Package files:
100 /var/lib/dpkg/status
release a=now
100 http://ftp.debian.org/debian stretch-backports/main amd64 Packages
release o=Debian Backports,a=stretch-backports,n=stretch-backports,l=Debian Backports,c=main,b=amd64
origin ftp.debian.org
500 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
origin security.debian.org
500 http://deb.debian.org/debian stretch-updates/main amd64 Packages
release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
origin deb.debian.org
500 http://deb.debian.org/debian stretch/main amd64 Packages
release v=9.4,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
origin deb.debian.org
Pinned packages:
和
apt purge libwinpr2
输出是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libfreerdp-client2-2 : Depends: libwinpr2-2 (>= 2.0.0~git20170725.1.1648deb+dfsg1) but it is not going to be installed
libfreerdp2-2 : Depends: libwinpr2-2 (>= 2.0.0~git20161130.1.e60d0d5+dfsg1) but it is not going to be installed
remmina-plugin-rdp : Depends: libwinpr2-2 (>= 2.0.0~git20160317.1.75ae3f5+dfsg1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
我该如何解决这个问题?
问题是由 引起的
libwinpr2
,它与 Debian 9 中可用的任何内容都不对应(这是您的存储库设置为正确跟踪的内容)。要解决此问题,您需要删除软件包以及依赖于它的任何内容:
希望这能在不造成太大破坏的情况下工作,但是,如果
apt
告诉你它将删除太多的包,告诉它不要(它会问你),并同时使用它aptitude
来安装remmina-plugin-rdp
(或其他任何依赖libwinpr2-2
)你删除libwinpr2
:(注意最后的下划线,它告诉
aptitude
清除包)。我用这些方法解决了这个问题: