web-dev-qa-db-fra.com

Paquets cassés après la mise à niveau d'Ubuntu 18.04

Récemment, j'ai mis à niveau Ubuntu 16 à Ubuntu 18. Tout fonctionne très bien puis plus tôt et fonctionne bien. Cependant, je ne peux pas installer ou supprimer de package. J'ai fait des recherches sur les réponses multiples sur ce forum. Mais aucune des solutions ne fonctionne pour moi. Voici les étapes que j'ai effectuées.

$ Sudo 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:
 imagemagick-6.q16 : Breaks: libmagickcore-dev (< 8:6.9.2.10+dfsg-2~) but 8:6.7.7.10-6ubuntu3.12 is installed
 libmagick++-6.q16-dev : Breaks: libmagick++-dev (< 8:6.8.3.10-1~)
 libmagick++-dev : Depends: libmagickwand-dev (= 8:6.7.7.10-6ubuntu3.12) but it is not installed
 libmagickcore-6.q16-dev : Breaks: libmagickcore-dev (< 8:6.8.3.10-1~) but 8:6.7.7.10-6ubuntu3.12 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Selon la suggestion en sortie, j'exécute la commande suivante:

$ Sudo 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:
  gnome-keyring-pkcs11:i386 gstreamer1.0-Nice hardening-includes icc-profiles-free imagemagick-common libaccount-plugin-google libaether-Java libamd2.2.0 libantlr4-runtime-Java
  libapache2-mod-php libapache2-mod-php7.0 libapparmor-Perl libappstream3 libasm3-Java libasm4-Java libasync-http-client-Java libautodie-Perl libavcodec53 libavformat53 libavutil51
  libbatik-Java libbind9-90 libblas3gf libchamplain-gtk-0.12-0 libclassworlds-Java libcloog-isl4 libclutter-gst-2.0-0 libcodenarc-groovy-Java libcolamd2.8.0 libcolorhug1
  libcommons-beanutils-Java libcommons-collections4-Java libcommons-compress-Java libcommons-configuration-Java libcommons-digester-Java libcommons-httpclient-Java
  libcommons-jexl2-Java libcommons-jxpath-Java libcommons-net2-Java libcommons-vfs-Java libdbd-mysql-Perl libdbi-Perl libdns100 libdoxia-core-Java libdoxia-Java libeasymock-Java
  libefivar0 libexiv2-12 libfontbox-Java libfop-Java libfwup0 libfwupd1 libgadu3 libgcrypt11:i386 libgegl-0.2-0 libgeronimo-ejb-3.2-spec-Java libgeronimo-jpa-2.0-spec-Java
  libgeronimo-osgi-support-Java libgeronimo-validation-1.0-spec-Java libgif4 libgif4:i386 libgmetrics-groovy-Java libgnuinet-Java libgnujaf-Java libgnumail-Java libgnutls-openssl27
  libgnutls26:i386 libgphoto2-port10 libgphoto2-port10:i386 libgraphviz-dev libgstreamer-plugins-base0.10-0:i386 libgstreamer0.10-0:i386 libgtkspell3-3-0 libgvc6-plugins-gtk
  libgweather-3-6 libhud2 libilmbase6 libisc95 libisccc90 libisccfg90 libisl10 libisl15 libitext1-Java libjackrabbit-Java libjaffl-Java libjasper-dev libjavascriptcoregtk-1.0-0
  libjctools-Java libjetty-extra libjetty-extra-Java libjetty-Java libjffi-Java libjffi-jni libjnr-constants-Java libjnr-ffi-Java libjnr-posix-Java libjnr-x86asm-Java
  libjson-c2:i386 liblept4 liblinear1 liblwres90 libmagick++5 libmagickcore-dev libmagickcore5 libmagickcore5-extra libmagickwand5 libmaven-ant-tasks-Java libmaven-archiver-Java
  libmaven-scm-Java libmaven2-core-Java libmockobjects-Java libmodello-Java libmx4j-Java libmysqlclient18:i386 libmysqlclient20 libnet-daemon-Perl libnetty-Java libopenexr6
  libopenraw1 libosgi-foundation-ee-Java libp11-kit-gnome-keyring libp11-kit-gnome-keyring:i386 libpackagekit-glib2-16 libparboiled-Java libpegdown-Java libplexus-ant-factory-Java
  libplexus-archiver-Java libplexus-bsh-factory-Java libplexus-build-api-Java libplexus-classworlds2-Java libplexus-cli-Java libplexus-i18n-Java libplexus-interactivity-api-Java
  libplexus-io-Java libpng12-0:i386 libpoppler-qt4-4 libpoppler44 libprocps3 libprotobuf-c1 libprotobuf8 libprotoc8 libqt5opengl5 libqt5organizer5 libqtwebkit4 libraw9 libsaxon-Java
  libschroedinger-1.0-0 libservlet2.5-Java libservlet3.0-Java libsisu-guice-Java libsisu-ioc-Java libsnappy-Java libsnappy-jni libspice-client-gtk-3.0-4 libspring-aop-Java
  libspring-context-Java libspring-expression-Java libspring-instrument-Java libsub-identify-Perl libsystemd-login0 libterm-readkey-Perl libtesseract3 libtinyxml2.6.2
  libtomcat7-Java libtxc-dxtn-s2tc0 libtxc-dxtn-s2tc0:i386 libufe-xidgetter0 libumfpack5.4.0 libunity-action-qt1 libustr-1.0-1 libva1 libvpx1 libvpx3 libvpx3:i386 libwagon-ftp-Java
  libwagon-Java libwagon2-Java libwebkitgtk-1.0-0 libwebpmux1 libwxbase2.8-0 libwxgtk2.8-0 libxbean-Java libxdot4 libxmlgraphics-commons-Java libxtables10 linux-headers-3.13.0-156
  linux-headers-3.13.0-156-generic linux-image-3.13.0-156-generic linux-image-extra-3.13.0-156-generic odbcinst odbcinst1debian2 oxideqt-codecs p11-kit-modules:i386 pgdg-keyring
  Pidgin-data plainbox-provider-checkbox plainbox-provider-resource-generic python-certifi python-distlib python-pyatspi python-requests python3-pycurl
  qtdeclarative5-accounts-plugin qtdeclarative5-localstorage-plugin qtdeclarative5-unity-action-plugin signon-keyring-extension signon-plugin-password signon-ui snapd-login-service
  tesseract-ocr-equ ubuntu-ui-toolkit-theme unixodbc wine-gecko2.21 wine-gecko2.21:i386 wine-mono0.0.8 wine1.6-AMD64 wine1.6-i386:i386
Use 'Sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libmagick++-dev libmagickcore-dev
The following packages will be upgraded:
  libmagick++-dev libmagickcore-dev
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/2,780 B of archives.
After this operation, 6,226 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 1227136 files and directories currently installed.)
Preparing to unpack .../libmagick++-dev_8%3a6.9.7.4+dfsg-16ubuntu6.3_all.deb ...
dpkg-query: no packages found matching libmagick++-dev:all
dpkg-query: package 'libmagick++-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagick++-dev' not owned by package 'libmagick++-dev:all'
dpkg-query: package 'libmagick++-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagick++-dev/NEWS.Debian.gz' not owned by package 'libmagick++-dev:all'
dpkg-query: package 'libmagick++-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagick++-dev/changelog.Debian.gz' not owned by package 'libmagick++-dev:all'
dpkg-query: package 'libmagick++-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagick++-dev/copyright' not owned by package 'libmagick++-dev:all'
dpkg-maintscript-helper: error: directory '/usr/share/doc/libmagick++-dev' contains files not owned by package libmagick++-dev:all, cannot switch to symlink
dpkg: error processing archive /var/cache/apt/archives/libmagick++-dev_8%3a6.9.7.4+dfsg-16ubuntu6.3_all.deb (--unpack):
 new libmagick++-dev package pre-installation script subprocess returned error exit status 1
Preparing to unpack .../libmagickcore-dev_8%3a6.9.7.4+dfsg-16ubuntu6.3_all.deb ...
dpkg-query: no packages found matching libmagickcore-dev:all
dpkg-query: package 'libmagickcore-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagickcore-dev' not owned by package 'libmagickcore-dev:all'
dpkg-query: package 'libmagickcore-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagickcore-dev/NEWS.Debian.gz' not owned by package 'libmagickcore-dev:all'
dpkg-query: package 'libmagickcore-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagickcore-dev/changelog.Debian.gz' not owned by package 'libmagickcore-dev:all'
dpkg-query: package 'libmagickcore-dev' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
dpkg-maintscript-helper: error: file '/usr/share/doc/libmagickcore-dev/copyright' not owned by package 'libmagickcore-dev:all'
dpkg-maintscript-helper: error: directory '/usr/share/doc/libmagickcore-dev' contains files not owned by package libmagickcore-dev:all, cannot switch to symlink
dpkg: error processing archive /var/cache/apt/archives/libmagickcore-dev_8%3a6.9.7.4+dfsg-16ubuntu6.3_all.deb (--unpack):
 new libmagickcore-dev package pre-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/libmagick++-dev_8%3a6.9.7.4+dfsg-16ubuntu6.3_all.deb
 /var/cache/apt/archives/libmagickcore-dev_8%3a6.9.7.4+dfsg-16ubuntu6.3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
2
Darshan Patel

J'ai essayé les commandes ci-dessous selon l'aide des forums en ligne, mais aucune des commandes ci-dessous ne fonctionne:

Sudo apt-get clean
Sudo apt-get autoclean
Sudo apt-get autoremove
Sudo apt-get -f install
Sudo apt-get upgrade
Sudo apt-get --purge remove package_name

Après avoir passé presque toute la journée, j'ai trouvé une suggestion dans l'une des réponses de ce forum. J'ai donc supprimé toutes les informations de package cassées mentionnées une par une du fichier nommé /var/lib/dpkg/status.

Je sais, c'est un processus très fastidieux. Mais c'est la seule chose qui fonctionne pour moi.

4
Darshan Patel