将 Debian Stretch 升级到 Buster 时出现包错误

将 Debian Stretch 升级到 Buster 时出现包错误

我正在尝试将 Debian 从 Stretch 升级到 Buster,但是有两个软件包具有软件包管理器无法解决的依赖关系(请参阅升级输出):

  • uget:不知何故,包管理器具有旧的依赖项(它搜索libcurl3而不是libcurl4作为它应该)尽管已经运行了apt update几次。

  • virtualbox-ext-pack:我已经读到 VirtualBox 是不支持上巴斯特并评论了stretch-backports我的sources.list文件。尽管如此,它还是试图修复依赖关系。

我尝试删除软件包(请参阅消除输出)和其他一些标准命令无济于事。

我应该做什么来修复系统?

相关输出

更新

myname# apt update
Hit:1 http://security.debian.org buster/updates InRelease
Hit:2 http://ftp.debian.org/debian buster InRelease                                       
Hit:3 https://repo.skype.com/deb stable InRelease                                               
Hit:4 https://updates.signal.org/desktop/apt xenial InRelease                                  
Reading package lists... Done
Building dependency tree       
Reading state information... Done
579 packages can be upgraded. Run 'apt list --upgradable' to see them.

升级

myname# apt upgrade             
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:
 uget : Depends: libcurl3 (>= 7.16.2) but it is not installable
 virtualbox-ext-pack : Depends: virtualbox (>= 5.2.24-dfsg-0~) or
                                virtualbox-5.2 but it is not installable
                       Depends: virtualbox (< 5.2.24-dfsg-z) or
                                virtualbox-5.2 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

--修复损坏的

myname# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  alsa-base bluedevil brasero brasero-cdrkit ca-certificates-mono dolphin4 dvdauthor ebtables eclipse-platform-data fonts-hack-ttf fonts-oxygen
  gfortran-mingw-w64 gfortran-mingw-w64-i686 gfortran-mingw-w64-x86-64 gir1.2-gepub-0.4 gir1.2-javascriptcoregtk-3.0 gir1.2-tracker-1.0
  gir1.2-zeitgeist-2.0 gnat-mingw-w64 gnat-mingw-w64-base gnat-mingw-w64-i686 gnat-mingw-w64-x86-64 gnome-icon-theme-symbolic gnome-tweak-tool
  growisofs iputils-arping kde-baseapps-data kde-config-sddm kde-style-oxygen-qt5 kdepasswd kdepim-doc kgamma5 kmenuedit kpart-webkit ktnef kwrited
  libasm3-java libattr1:i386 libavcodec57:i386 libavresample3:i386 libavutil55:i386 libblas-common libcamel-1.2-59 libclassworlds-java libcln6
  libcoin80v5 libcomerr2:i386 libcommons-beanutils-java libcommons-collections3-java libcommons-dbcp-java libcommons-digester-java
  libcommons-httpclient-java libcommons-lang-java libcommons-pool-java libcryptui0a libdata-random-perl libdb-java libdb-je-java libdb5.3-java
  libdb5.3-java-jni libdoxia-core-java libeasymock-java libebook-1.2-16 libeclipse-aether-java libedata-cal-1.2-28 libedataserver-1.2-22
  libedataserverui-1.2-1 libequinox-osgi-java libextutils-depends-perl libextutils-pkgconfig-perl libfelix-bundlerepository-java
  libfelix-gogo-command-java libfelix-gogo-runtime-java libfelix-gogo-shell-java libfelix-osgi-obr-java libfelix-shell-java libfelix-utils-java
  libfile-copy-recursive-perl libfile-slurp-tiny-perl libfwupd1 libgcab-1.0-0 libgcr-3-common libgd-perl libgeos-3.4.2 libgepub0 libgit2-24
  libgles2-mesa libgltf-0.0-0v5 libgnome-autoar-common libgnome-desktop-3-12 libgom-1.0-common libgoocanvas-common libgoocanvas3
  libgtk2-ex-podviewer-perl libgtk2-ex-simple-list-perl libgutenprint2 libgweather-3-6 libhttp-parser2.1 libhttp-server-simple-perl libical2
  libicu4j-4.2-java libicu4j-49-java libicu57:i386 libidn11:i386 libiodbc2 libjavascriptcoregtk-3.0-0 libjetty9-java libjgraph-java
  libjgrapht0.8-java libjson-pp-perl libjtidy-java libkdecorations2private5v5 libkf5akonadicore-bin libkf5akonadiprivate5 libkf5calendarcore5
  libkf5dbusaddons-bin libkf5gapi-data libkf5gpgmepp-pthread5 libkf5iconthemes-bin libkf5incidenceeditor-bin libkf5kdgantt2-5
  libkf5mailcommon-plugins libkf5pimcommon-plugins libkf5qgpgme5 libkf5syndication5 libkf5webkit5 libkonqsidebarplugin4a libkxmlrpcclient4
  liblivemedia57 liblucene2-java libmaven2-core-java libmcrypt4 libmetadata-extractor-java libmouse-perl libmozjs-24-0 libmysqlclient18
  libnet-dropbox-api-perl libnet-oauth-perl libnetty-3.9-java libnfs8 libobjc-6-dev libobjenesis-java liboce-foundation10 liboce-modeling10
  liboce-ocaf-lite10 liboce-ocaf10 liboce-visualization10 libopencv-calib3d2.4v5 libopencv-features2d2.4v5 libopencv-flann2.4v5
  libopencv-objdetect2.4v5 libopencv-video2.4v5 libopenspecfun1 liborcus-0.11-0 liboxygenstyle5-5 liboxygenstyleconfig5-5 libpackagekitqt5-0
  libpath-class-perl libplexus-ant-factory-java libplexus-bsh-factory-java libplexus-classworlds2-java libplexus-cli-java
  libplexus-component-metadata-java libplexus-container-default-java libplexus-container-default1.5-java libplexus-containers1.5-java
  libplexus-interactivity-api-java libpodofo0.9.4 libproc-simple-perl libproj0 libprotobuf-lite10 libpyside-py3-1.2 libpython3.5-dev
  libqcustomplot1.3 libqdox2-java libqgsttools-p1 libqpdf17 libqt5clucene5 libqt5designercomponents5 libqt5multimediaquick-p5 libre2-3 librpm3
  librpmbuild3 librpmio3 librpmsign3 libsane-extras libsane-extras:i386 libsane-extras-common libsane-extras-dev libshiboken-py3-1.2v5
  libsndio6.1:i386 libsodium18 libsoprano4 libsoqt4-20 libsort-naturally-perl libspeexdsp1:i386 libsuitesparseconfig4 libswresample2:i386
  libswt-cairo-gtk-3-jni libswt-glx-gtk-3-jni libswt-gnome-gtk-3-jni libswt-gtk-3-java libswt-gtk-3-jni libswt-webkit-gtk-3-jni libsynctex1
  libtomcat8-java libtracker-control-1.0-0 libtracker-miner-1.0-0 libtracker-sparql-1.0-0 libtxc-dxtn-s2tc:i386 libunbound2 libva-drm1:i386
  libva-wayland1 libvpx4:i386 libvte-common libvte9 libwagon-ftp-java libwagon-java libwebkitgtk-3.0-0 libwebpmux2:i386 libwww-mechanize-perl
  libx11-protocol-other-perl libx264-148:i386 libx265-95:i386 libxbean-java libxfont1 libxmpcore-java octave-info owncloud-files perlmagick
  php-xml-parser php5-intl php5-ldap php5-mcrypt php5-mysql php5-pgsql php5-sqlite plasma-discover plasma-discover-common python-antlr python-pam
  python-ply python-pyinotify python-qt4-gl python3-tz python3.5 python3.5-dev python3.5-minimal qdoc-qt5 qml-module-org-kde-extensionplugin
  qml-module-org-kde-kirigami qpdf qt5-assistant qttools5-dev-tools rename sat4j seahorse-daemon software-properties-kde soprano-daemon tcpd
  user-manager virtualbox-guest-utils vlc-plugin-visualization
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  uget
The following packages will be REMOVED:
  virtualbox-ext-pack
The following packages will be upgraded:
  uget
1 upgraded, 0 newly installed, 1 to remove and 578 not upgraded.
Need to get 0 B/369 kB of archives.
After this operation, 14.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Reading changelogs... Done
(Reading database ... 670161 files and directories currently installed.)
Removing virtualbox-ext-pack (5.2.24-2~bpo9+1) ...
/var/lib/dpkg/info/virtualbox-ext-pack.prerm: 4: /var/lib/dpkg/info/virtualbox-ext-pack.prerm: vboxmanage: not found
dpkg: error processing package virtualbox-ext-pack (--remove):
 installed virtualbox-ext-pack package pre-removal script subprocess returned error exit status 127
Errors were encountered while processing:
 virtualbox-ext-pack
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 181 files, found 153
E: Sub-process /usr/bin/dpkg returned an error code (1)

远程升级

myname# apt dist-upgrade        
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:
 uget : Depends: libcurl3 (>= 7.16.2) but it is not installable
 virtualbox-ext-pack : Depends: virtualbox (>= 5.2.24-dfsg-0~) or
                                virtualbox-5.2 but it is not installable
                       Depends: virtualbox (< 5.2.24-dfsg-z) or
                                virtualbox-5.2 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

删除包

myname# apt remove uget virtualbox-ext-pack
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  alsa-base bluedevil brasero brasero-cdrkit ca-certificates-mono dolphin4 dvdauthor ebtables eclipse-platform-data fonts-hack-ttf fonts-oxygen
  gfortran-mingw-w64 gfortran-mingw-w64-i686 gfortran-mingw-w64-x86-64 gir1.2-gepub-0.4 gir1.2-javascriptcoregtk-3.0 gir1.2-tracker-1.0
  gir1.2-zeitgeist-2.0 gnat-mingw-w64 gnat-mingw-w64-base gnat-mingw-w64-i686 gnat-mingw-w64-x86-64 gnome-icon-theme-symbolic gnome-tweak-tool
  growisofs iputils-arping kde-baseapps-data kde-config-sddm kde-style-oxygen-qt5 kdepasswd kdepim-doc kgamma5 kmenuedit kpart-webkit ktnef kwrited
  libasm3-java libattr1:i386 libavcodec57:i386 libavresample3:i386 libavutil55:i386 libblas-common libcamel-1.2-59 libclassworlds-java libcln6
  libcoin80v5 libcomerr2:i386 libcommons-beanutils-java libcommons-collections3-java libcommons-dbcp-java libcommons-digester-java
  libcommons-httpclient-java libcommons-lang-java libcommons-pool-java libcryptui0a libdata-random-perl libdb-java libdb-je-java libdb5.3-java
  libdb5.3-java-jni libdoxia-core-java libeasymock-java libebook-1.2-16 libeclipse-aether-java libedata-cal-1.2-28 libedataserver-1.2-22
  libedataserverui-1.2-1 libequinox-osgi-java libextutils-depends-perl libextutils-pkgconfig-perl libfelix-bundlerepository-java
  libfelix-gogo-command-java libfelix-gogo-runtime-java libfelix-gogo-shell-java libfelix-osgi-obr-java libfelix-shell-java libfelix-utils-java
  libfile-copy-recursive-perl libfile-slurp-tiny-perl libfwupd1 libgcab-1.0-0 libgcr-3-common libgd-perl libgeos-3.4.2 libgepub0 libgit2-24
  libgles2-mesa libgltf-0.0-0v5 libgnome-autoar-common libgnome-desktop-3-12 libgom-1.0-common libgoocanvas-common libgoocanvas3
  libgtk2-ex-podviewer-perl libgtk2-ex-simple-list-perl libgutenprint2 libgweather-3-6 libhttp-parser2.1 libhttp-server-simple-perl libical2
  libicu4j-4.2-java libicu4j-49-java libicu57:i386 libidn11:i386 libiodbc2 libjavascriptcoregtk-3.0-0 libjetty9-java libjgraph-java
  libjgrapht0.8-java libjson-pp-perl libjtidy-java libkdecorations2private5v5 libkf5akonadicore-bin libkf5akonadiprivate5 libkf5calendarcore5
  libkf5dbusaddons-bin libkf5gapi-data libkf5gpgmepp-pthread5 libkf5iconthemes-bin libkf5incidenceeditor-bin libkf5kdgantt2-5
  libkf5mailcommon-plugins libkf5pimcommon-plugins libkf5qgpgme5 libkf5syndication5 libkf5webkit5 libkonqsidebarplugin4a libkxmlrpcclient4
  liblivemedia57 liblucene2-java libmaven2-core-java libmcrypt4 libmetadata-extractor-java libmouse-perl libmozjs-24-0 libmysqlclient18
  libnet-dropbox-api-perl libnet-oauth-perl libnetty-3.9-java libnfs8 libobjc-6-dev libobjenesis-java liboce-foundation10 liboce-modeling10
  liboce-ocaf-lite10 liboce-ocaf10 liboce-visualization10 libopencv-calib3d2.4v5 libopencv-features2d2.4v5 libopencv-flann2.4v5
  libopencv-objdetect2.4v5 libopencv-video2.4v5 libopenspecfun1 liborcus-0.11-0 liboxygenstyle5-5 liboxygenstyleconfig5-5 libpackagekitqt5-0
  libpath-class-perl libplexus-ant-factory-java libplexus-bsh-factory-java libplexus-classworlds2-java libplexus-cli-java
  libplexus-component-metadata-java libplexus-container-default-java libplexus-container-default1.5-java libplexus-containers1.5-java
  libplexus-interactivity-api-java libpodofo0.9.4 libproc-simple-perl libproj0 libprotobuf-lite10 libpyside-py3-1.2 libpython3.5-dev
  libqcustomplot1.3 libqdox2-java libqgsttools-p1 libqpdf17 libqt5clucene5 libqt5designercomponents5 libqt5multimediaquick-p5 libre2-3 librpm3
  librpmbuild3 librpmio3 librpmsign3 libsane-extras libsane-extras:i386 libsane-extras-common libsane-extras-dev libshiboken-py3-1.2v5
  libsndio6.1:i386 libsodium18 libsoprano4 libsoqt4-20 libsort-naturally-perl libspeexdsp1:i386 libsuitesparseconfig4 libswresample2:i386
  libswt-cairo-gtk-3-jni libswt-glx-gtk-3-jni libswt-gnome-gtk-3-jni libswt-gtk-3-java libswt-gtk-3-jni libswt-webkit-gtk-3-jni libsynctex1
  libtomcat8-java libtracker-control-1.0-0 libtracker-miner-1.0-0 libtracker-sparql-1.0-0 libtxc-dxtn-s2tc:i386 libunbound2 libva-drm1:i386
  libva-wayland1 libvpx4:i386 libvte-common libvte9 libwagon-ftp-java libwagon-java libwebkitgtk-3.0-0 libwebpmux2:i386 libwww-mechanize-perl
  libx11-protocol-other-perl libx264-148:i386 libx265-95:i386 libxbean-java libxfont1 libxmpcore-java octave-info owncloud-files perlmagick
  php-xml-parser php5-intl php5-ldap php5-mcrypt php5-mysql php5-pgsql php5-sqlite plasma-discover plasma-discover-common python-antlr python-pam
  python-ply python-pyinotify python-qt4-gl python3-tz python3.5 python3.5-dev python3.5-minimal qdoc-qt5 qml-module-org-kde-extensionplugin
  qml-module-org-kde-kirigami qpdf qt5-assistant qttools5-dev-tools rename sat4j seahorse-daemon software-properties-kde soprano-daemon tcpd
  user-manager virtualbox-guest-utils vlc-plugin-visualization
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  uget virtualbox-ext-pack
0 upgraded, 0 newly installed, 2 to remove and 578 not upgraded.
After this operation, 1509 kB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 670161 files and directories currently installed.)
Removing uget (2.0.8-1+b1) ...
Removing virtualbox-ext-pack (5.2.24-2~bpo9+1) ...
/var/lib/dpkg/info/virtualbox-ext-pack.prerm: 4: /var/lib/dpkg/info/virtualbox-ext-pack.prerm: vboxmanage: not found
dpkg: error processing package virtualbox-ext-pack (--remove):
 installed virtualbox-ext-pack package pre-removal script subprocess returned error exit status 127
Errors were encountered while processing:
 virtualbox-ext-pack
[ Rootkit Hunter version 1.4.6 ]
File updated: searched for 181 files, found 153
E: Sub-process /usr/bin/dpkg returned an error code (1)

清洁和自动清洁

apt cleanapt autoclean运行没有问题

自动删除

myname# apt autoremove                     
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:
 virtualbox-ext-pack : Depends: virtualbox (>= 5.2.24-dfsg-0~) or
                                virtualbox-5.2 but it is not installable
                       Depends: virtualbox (< 5.2.24-dfsg-z) or
                                virtualbox-5.2 but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

答案1

根据您的日志,uget已被删除;现在您应该可以重新安装 Debian 10 版本了。

要删除virtualbox-ext-pack,您通常需要virtualbox;不幸的是,由于stretch-backports' 版本依赖于 Python 3.5,因此无法轻松安装在 Debian 10 中。要解决卸载错误,您需要删除维护者脚本voxmanage中的两行prerm

sudo sed -i '/vboxmanage/d' /var/lib/dpkg/info/virtualbox-ext-pack.prerm

这将允许您删除该virtualbox-ext-pack包。

相关内容