我正在尝试在 Ubuntu 20.04 上安装 Wine。但是,当我尝试使用apt
命令行执行此操作时,它说它将删除 Apache2、Blender 和其他一些东西。知道为什么吗?
$ sudo apt-get install wine64
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
apache2-data apache2-utils blender-data libaprutil1-dbd-sqlite3 libaprutil1-ldap libblosc1 libdcmtk14 libglew2.1 libjemalloc2 libopenimageio2.1 libopenvdb6.2
libosdcpu3.4.0 libosdgpu3.4.0 libspnav0 libsquish0 php7.2-readline
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
fonts-wine libcapi20-3 libfaudio0 libosmesa6 libstb0 libvkd3d1 libwine wine
Suggested packages:
gstreamer1.0-plugins-bad q4wine winbind winetricks playonlinux wine-binfmt dosbox wine64-preloader
Recommended packages:
wine32
The following packages will be REMOVED
apache2 apache2-bin blender libapache2-mod-php7.2 php-fpm php-gd php7.2 php7.2-cli php7.2-fpm php7.3 php7.3-fpm php7.3-gd php7.4-fpm php7.4-gd silversearcher-ag
whois
The following NEW packages will be installed
fonts-wine libcapi20-3 libfaudio0 libosmesa6 libstb0 libvkd3d1 libwine wine wine64
0 to upgrade, 9 to newly install, 16 to remove and 4 not to upgrade.
Need to get 28.5 MB of archives.
After this operation, 122 MB of additional disk space will be used.
Do you want to continue? [Y/n]
我还要补充一点,这些不是标记为删除的不需要的依赖项,如该命令所示:
$ sudo apt-get autoremove
# ...
0 to upgrade, 0 to newly install, 0 to remove and 4 not to upgrade.
编辑:感谢 Brian Turek 的提示,我尝试使用 aptitude 安装它:
$ sudo apt install aptitude
# ...
$ sudo aptitude install wine64
The following NEW packages will be installed:
fonts-wine{a} glib-networking:i386{a} gstreamer1.0-plugins-base:i386{a} gstreamer1.0-plugins-good:i386{a} gstreamer1.0-x:i386{a} i965-va-driver:i386{a}
intel-media-va-driver:i386{a} libaa1:i386{a} libaom0:i386{a} libasn1-8-heimdal:i386{a} libasound2:i386{a} libasound2-plugins:i386{a} libasyncns0:i386{a}
libavahi-client3:i386{a} libavahi-common-data:i386{a} libavahi-common3:i386{a} libavc1394-0:i386{a} libavcodec58:i386{a} libavutil56:i386{a} libblkid1:i386{a}
libbrotli1:i386{a} libbz2-1.0:i386{a} libcaca0:i386{a} libcairo-gobject2:i386{a} libcairo2:i386{a} libcap2:i386{a} libcapi20-3{a} libcapi20-3:i386{a}
libcdparanoia0:i386{a} libcodec2-0.9:i386{a} libcom-err2:i386{a} libcups2:i386{a} libcurl3-gnutls:i386{a} libdatrie1:i386{a} libdb5.3:i386{a}
libdbus-1-3:i386{a} libdv4:i386{a} libexif12:i386{a} libfaudio0{a} libfaudio0:i386{a} libflac8:i386{a} libfontconfig1:i386{a} libfreetype6:i386{a}
libfribidi0:i386{a} libgcrypt20:i386{a} libgd3:i386{ab} libgdbm-compat4:i386{a} libgdbm6:i386{a} libgdk-pixbuf2.0-0:i386{a} libglib2.0-0:i386{a}
libglu1-mesa:i386{a} libgmp10:i386{a} libgnutls30:i386{a} libgomp1:i386{a} libgpg-error0:i386{a} libgphoto2-6:i386{a} libgphoto2-port12:i386{a} libgpm2:i386{a}
libgraphite2-3:i386{a} libgsm1:i386{a} libgssapi-krb5-2:i386{a} libgssapi3-heimdal:i386{a} libgstreamer-plugins-base1.0-0:i386{a}
libgstreamer-plugins-good1.0-0:i386{a} libgstreamer1.0-0:i386{a} libgudev-1.0-0:i386{a} libharfbuzz0b:i386{a} libhcrypto4-heimdal:i386{a}
libheimbase1-heimdal:i386{a} libheimntlm0-heimdal:i386{a} libhogweed5:i386{a} libhx509-5-heimdal:i386{a} libicu66:i386{a} libidn2-0:i386{ab}
libiec61883-0:i386{a} libieee1284-3:i386{a} libigdgmm11:i386{a} libjack-jackd2-0:i386{a} libjbig0:i386{a} libjpeg-turbo8:i386{a} libjpeg8:i386{a}
libk5crypto3:i386{a} libkeyutils1:i386{a} libkrb5-26-heimdal:i386{a} libkrb5-3:i386{a} libkrb5support0:i386{a} liblcms2-2:i386{a} libldap-2.4-2:i386{a}
libltdl7:i386{a} liblz4-1:i386{a} liblzma5:i386{a} libmount1:i386{a} libmp3lame0:i386{a} libmpg123-0:i386{a} libmysqlclient21:i386{a} libncurses6:i386{a}
libncursesw6:i386{a} libnettle7:i386{a} libnghttp2-14:i386{a} libnuma1:i386{a} libodbc1:i386{a} libogg0:i386{a} libopenal1:i386{a} libopenjp2-7:i386{a}
libopus0:i386{a} liborc-0.4-0:i386{a} libosmesa6{a} libosmesa6:i386{a} libp11-kit0:i386{a} libpango-1.0-0:i386{a} libpangocairo-1.0-0:i386{a}
libpangoft2-1.0-0:i386{a} libpcap0.8:i386{a} libpci3:i386{a} libpcre2-8-0:i386{ab} libpcre3:i386{ab} libperl5.30:i386{a} libpixman-1-0:i386{a}
libpng16-16:i386{a} libproxy1v5:i386{a} libpsl5:i386{a} libpulse0:i386{a} libraw1394-11:i386{a} libroken18-heimdal:i386{a} librsvg2-2:i386{a}
librsvg2-common:i386{a} librtmp1:i386{a} libsamplerate0:i386{a} libsane:i386{a} libsasl2-2:i386{a} libsasl2-modules:i386{a} libsasl2-modules-db:i386{a}
libsdl2-2.0-0:i386{a} libselinux1:i386{a} libshine3:i386{a} libshout3:i386{a} libslang2:i386{a} libsnappy1v5:i386{a} libsndfile1:i386{a} libsndio7.0:i386{a}
libsnmp35:i386{a} libsoup2.4-1:i386{a} libsoxr0:i386{a} libspeex1:i386{a} libsqlite3-0:i386{a} libssh-4:i386{a} libssl1.1:i386{a} libstb0{a} libstb0:i386{a}
libswresample3:i386{a} libsystemd0:i386{a} libtag1v5:i386{a} libtag1v5-vanilla:i386{a} libtasn1-6:i386{a} libthai0:i386{a} libtheora0:i386{a} libtiff5:i386{a}
libtwolame0:i386{a} libudev1:i386{a} libunistring2:i386{a} libusb-1.0-0:i386{a} libuuid1:i386{a} libv4l-0:i386{a} libv4lconvert0:i386{a} libva-drm2:i386{a}
libva-x11-2:i386{a} libva2:i386{a} libvdpau1:i386{a} libvisual-0.4-0:i386{a} libvkd3d1{a} libvkd3d1:i386{a} libvorbis0a:i386{a} libvorbisenc2:i386{a}
libvpx6:i386{a} libwavpack1:i386{a} libwayland-cursor0:i386{a} libwayland-egl1:i386{a} libwebp6:i386{a} libwebpmux3:i386{a} libwind0-heimdal:i386{a} libwine{a}
libwine:i386{a} libwrap0:i386{a} libx264-155:i386{a} libx265-179:i386{a} libxcb-render0:i386{a} libxcb-shm0:i386{a} libxcb-xfixes0:i386{a}
libxcomposite1:i386{a} libxcursor1:i386{a} libxi6:i386{a} libxinerama1:i386{a} libxkbcommon0:i386{a} libxml2:i386{a} libxpm4:i386{a} libxrandr2:i386{a}
libxrender1:i386{a} libxslt1.1:i386{a} libxss1:i386{a} libxv1:i386{a} libxvidcore4:i386{a} libzvbi0:i386{a} mesa-va-drivers:i386{a} mesa-vdpau-drivers:i386{a}
ocl-icd-libopencl1:i386{a} va-driver-all:i386{a} vdpau-driver-all:i386{a} wine{a} wine32:i386{a} wine64
0 packages upgraded, 210 newly installed, 0 to remove and 0 not upgraded.
Need to get 129 MB of archives. After unpacking 806 MB will be used.
The following packages have unmet dependencies:
libgd3 : Breaks: libgd3:i386 (!= 2.2.5-5.2+ubuntu18.04.1+deb.sury.org+1) but 2.2.5-5.2ubuntu2 is to be installed
libgd3:i386 : Breaks: libgd3 (!= 2.2.5-5.2ubuntu2) but 2.2.5-5.2+ubuntu18.04.1+deb.sury.org+1 is installed
libpcre3 : Breaks: libpcre3:i386 (!= 2:8.43-1+ubuntu18.04.1+deb.sury.org+1) but 2:8.39-12build1 is to be installed
libpcre3:i386 : Breaks: libpcre3 (!= 2:8.39-12build1) but 2:8.43-1+ubuntu18.04.1+deb.sury.org+1 is installed
libpcre2-8-0 : Breaks: libpcre2-8-0:i386 (!= 10.34-7+ubuntu18.04.1+deb.sury.org+1) but 10.34-7 is to be installed
libpcre2-8-0:i386 : Breaks: libpcre2-8-0 (!= 10.34-7) but 10.34-7+ubuntu18.04.1+deb.sury.org+1 is installed
libidn2-0 : Breaks: libidn2-0:i386 (!= 2.3.0-1+ubuntu18.04.1+deb.sury.org+1) but 2.2.0-2 is to be installed
libidn2-0:i386 : Breaks: libidn2-0 (!= 2.2.0-2) but 2.3.0-1+ubuntu18.04.1+deb.sury.org+1 is installed
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) glib-networking:i386 [Not Installed]
2) gstreamer1.0-plugins-base:i386 [Not Installed]
3) gstreamer1.0-plugins-good:i386 [Not Installed]
4) gstreamer1.0-x:i386 [Not Installed]
5) libavcodec58:i386 [Not Installed]
6) libcairo-gobject2:i386 [Not Installed]
7) libcups2:i386 [Not Installed]
8) libcurl3-gnutls:i386 [Not Installed]
9) libfaudio0:i386 [Not Installed]
10) libgd3:i386 [Not Installed]
11) libgdk-pixbuf2.0-0:i386 [Not Installed]
12) libglib2.0-0:i386 [Not Installed]
13) libgnutls30:i386 [Not Installed]
14) libgphoto2-6:i386 [Not Installed]
15) libgstreamer-plugins-base1.0-0:i386 [Not Installed]
16) libgstreamer-plugins-good1.0-0:i386 [Not Installed]
17) libgstreamer1.0-0:i386 [Not Installed]
18) libgudev-1.0-0:i386 [Not Installed]
19) libharfbuzz0b:i386 [Not Installed]
20) libidn2-0:i386 [Not Installed]
21) libldap-2.4-2:i386 [Not Installed]
22) libmount1:i386 [Not Installed]
23) libpango-1.0-0:i386 [Not Installed]
24) libpangocairo-1.0-0:i386 [Not Installed]
25) libpangoft2-1.0-0:i386 [Not Installed]
26) libpcre2-8-0:i386 [Not Installed]
27) libpcre3:i386 [Not Installed]
28) libpsl5:i386 [Not Installed]
29) librsvg2-2:i386 [Not Installed]
30) librsvg2-common:i386 [Not Installed]
31) librtmp1:i386 [Not Installed]
32) libsane:i386 [Not Installed]
33) libselinux1:i386 [Not Installed]
34) libsoup2.4-1:i386 [Not Installed]
35) libwine:i386 [Not Installed]
36) wine32:i386 [Not Installed]
Leave the following dependencies unresolved:
37) libgstreamer-plugins-base1.0-0:i386 recommends gstreamer1.0-plugins-base:i386
38) wine64 recommends wine32 (= 5.0-3ubuntu1)
Accept this solution? [Y/n/q/?]
编辑2:根据要求,这是以下命令的输出:
$ apt-cache policy "libpcre2-8-0:i386"
libpcre2-8-0:i386:
Installed: (none)
Candidate: 10.34-7
Version table:
10.34-7 500
500 http://archive.ubuntu.com/ubuntu focal/main i386 Packages
$ apt-cache policy libpcre2-8-0
libpcre2-8-0:
Installed: 10.34-7+ubuntu18.04.1+deb.sury.org+1
Candidate: 10.34-7+ubuntu18.04.1+deb.sury.org+1
Version table:
*** 10.34-7+ubuntu18.04.1+deb.sury.org+1 100
100 /var/lib/dpkg/status
10.34-7 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
答案1
事实证明,我遇到此问题是因为我从第三方存储库安装了软件包deb.sury.org。虽然我现在记不太清楚了,但我认为几个月前我曾从该存储库安装了较新版本的 PHP,可能是在升级到 Ubuntu 20.04 LTS 之前。即使该第三方存储库已被禁用(如“软件和更新”GUI 工具中所示),其中一些软件包仍会安装,并且版本号高于 Ubuntu 存储库中可用的版本号。这意味着它们没有被更新替换。
感谢布赖恩·图瑞克,以下是我为调查此事并找出原因所做的事情:
安装后aptitude
,我运行sudo aptitude install wine64
:
这给了我更多有用的错误消息,并表明问题在于与名为libpcre3
(和其他软件包) 的软件包的依赖关系要求存在冲突,特别是版本号2:8.43-1+ubuntu18.04.1+deb.sury.org+1
。这deb.sury.org
部分提示该软件包不是来自 Ubuntu 存储库,而是来自第三方存储库 deb.sury.org。
我使用以下方法检查了包的来源apt-cache policy libpcre2-8-0
这向我展示了这个输出:
$ apt-cache policy libpcre2-8-0
libpcre2-8-0:
Installed: 10.34-7+ubuntu18.04.1+deb.sury.org+1
Candidate: 10.34-7+ubuntu18.04.1+deb.sury.org+1
Version table:
*** 10.34-7+ubuntu18.04.1+deb.sury.org+1 100
100 /var/lib/dpkg/status
10.34-7 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
这表明已安装的版本是该deb.sury.org
版本,并且版本号最高的版本是该deb.sury.org
版本,但还有来自 Ubuntu 存储库(archive.ubuntu.com)的另一个版本。
此时,我决定从该存储库中删除所有软件包并重新安装 Ubuntu 存储库版本。
删除第三方存储库
如果第三方存储库尚未删除,我会使用“软件和更新”工具将其删除
列出从 deb.sury.org 安装的所有软件包
我通过运行以下命令创建了该存储库中所有软件包的列表:
apt list --installed | grep sury
从 deb.sury.org 卸载或重新安装软件包
对于列表中的每个包,我尝试卸载该包:
sudo apt uninstall PACKAGENAME
或者我会像这样从 Ubuntu 存储库重新安装它。我会从 Ubuntu 存储库中找到正确的版本号:
$ apt-cache madison libidn2-0
libidn2-0 | 2.2.0-2 | http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
然后我将使用该版本号重新安装它:
$ sudo apt install --reinstall libidn2-0=2.2.0-2
The following packages will be DOWNGRADED:
libidn2-0
# ...
答案2
实际上,卸载其他软件包的不是 wine,而是 apt 同时清理不需要的依赖项。有时,您可能安装了需要 Apache+PHP 的某个应用程序,然后使用 将其删除apt remove
。安装应用程序时,它需要一些依赖项,但删除时不会自动删除它们。
您可以通过运行来测试这一点sudo apt autoremove
,它会列出所有相同的包,然后将其删除。
答案3
如果您的问题来自软件包,deb.sury.org
也可以通过重新添加存储库来解决。我这样做是因为我确实想要那些版本。
sudo add-apt-repository ppa:ondrej/php
另请参阅https://deb.sury.org/和https://launchpad.net/~ondrej/+archive/ubuntu/php/。