In the process of upgrading my Kali2 distrib, I ran into a chicken-and-egg problem.
When I try to install something (anything) or even to autoremove, I get this:
vlt@kali2:~$ sudo apt-get autoremove
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:
libcrypt-ssleay-perl : Depends: perl (>= 5.24.1~rc4-1) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libcurses-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libdbd-sqlite3-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libdbi-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libdigest-md4-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libfcgi-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libgtk2-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libhtml-parser-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libmoose-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libnet-ssh2-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libpango-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libparams-classify-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libperl5.24 : Depends: perl-modules-5.24 (>= 5.24.1~rc4-1) but it is not installed
libpurple0 : Depends: perl-base (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libscalar-list-utils-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libsnmp-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libsub-identify-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libsub-name-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libterm-readline-gnu-perl : Depends: perl (>= 5.24.1~rc3-3) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libvariable-magic-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
libxml-libxml-perl : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
mysql-server-5.5 : Depends: mysql-client-5.5 (>= 5.5.50-0+deb8u1) but it is not installable
Depends: mysql-server-core-5.5 (>= 5.5.50-0+deb8u1) but it is not installable
perl-tk : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
texinfo : Depends: perl (>= 5.24.1~rc3-2) but 5.20.2-3+deb8u6 is installed
Depends: perlapi-5.24.1
vlc-nox : Depends: libtag1c2a (>= 1.9.1) but it is not installable
E: Unmet dependencies. Try using -f.
When I try to fix, I get a mysql-server-5.6 issue:
vlt@kali2:~$ sudo apt-get -f 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:
gstreamer0.10-gconf gstreamer0.10-nice gstreamer0.10-plugins-bad gstreamer0.10-x libbasicusageenvironment0 libcdaudio1 libchromaprint0 libdirac-encoder0 libdvbpsi9 libexporter-tiny-perl libfreerdp-rail1.1
libgroupsock1 libgstreamer-plugins-bad0.10-0 libintl-perl liblircclient0 liblist-moreutils-perl liblivemedia23 libmhash2 libmimic0 libpostproc52 libraptor2-0 librasqal3 librdf0 libslv2-9 libsoundtouch0
libtask-weaken-perl libusageenvironment1 libwildmidi1 libxcb-composite0 libyajl2 vlc-nox
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
apt apt-utils glib-networking glib-networking-common glib-networking-services libalgorithm-diff-xs-perl libapt-inst2.0 libapt-pkg-perl libapt-pkg5.0 libbasicusageenvironment1 libcairo-perl
libclass-c3-xs-perl libclass-load-xs-perl libcpan-meta-perl libdbd-mysql-perl libdevel-caller-perl libdevel-lexalias-perl libdigest-crc-perl libdouble-conversion1 libdvbpsi10 libebml4v5
libexporter-tiny-perl libfile-fcntllock-perl libglib-perl libgroupsock8 liblirc-client0 liblircclient0 liblist-moreutils-perl liblivemedia57 liblocale-gettext-perl liblz4-1 libmariadbclient18
libmatroska6v5 libnet-dbus-perl libnet-pcap-perl libnet-rawip-perl libnet-ssleay-perl libpackage-stash-xs-perl libpadwalker-perl libparams-util-perl libpcre16-3 libpcsc-perl libproxy-tools libproxy1v5
libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libqt5x11extras5 libsocket6-perl libterm-readkey-perl libtext-charwidth-perl libtext-iconv-perl libtext-soundex-perl
libusageenvironment3 libvlc-bin libvlccore8 libxcb-xinerama0 libxml-parser-perl mariadb-common mysql-common mysql-server mysql-server-5.6 mysql-server-core-5.6 perl perl-base perl-modules-5.24
phonon-backend-vlc qt5-gtk-platformtheme qttranslations5-l10n vlc vlc-bin vlc-data vlc-l10n vlc-nox vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba vlc-plugin-skins2
vlc-plugin-video-output vlc-plugin-video-splitter vlc-plugin-visualization
Suggested packages:
apt-doc libfont-freetype-perl lirc qt5-image-formats-plugins qtwayland5 tinyca perl-doc libdvdcss2
The following packages will be REMOVED:
libebml4 libmatroska6 libproxy1 mysql-server-5.5 perl-modules vlc-plugin-pulse
The following NEW packages will be installed:
libapt-inst2.0 libapt-pkg5.0 libbasicusageenvironment1 libdouble-conversion1 libdvbpsi10 libebml4v5 libexporter-tiny-perl libgroupsock8 liblirc-client0 liblivemedia57 liblz4-1 libmariadbclient18
libmatroska6v5 libpcre16-3 libproxy1v5 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5 libqt5svg5 libqt5widgets5 libqt5x11extras5 libusageenvironment3 libvlc-bin libxcb-xinerama0 mariadb-common
mysql-server-5.6 mysql-server-core-5.6 perl-modules-5.24 qt5-gtk-platformtheme qttranslations5-l10n vlc-bin vlc-l10n vlc-plugin-base vlc-plugin-qt vlc-plugin-skins2 vlc-plugin-video-output
vlc-plugin-video-splitter vlc-plugin-visualization
The following packages will be upgraded:
apt apt-utils glib-networking glib-networking-common glib-networking-services libalgorithm-diff-xs-perl libapt-pkg-perl libcairo-perl libclass-c3-xs-perl libclass-load-xs-perl libcpan-meta-perl
libdbd-mysql-perl libdevel-caller-perl libdevel-lexalias-perl libdigest-crc-perl libfile-fcntllock-perl libglib-perl liblircclient0 liblist-moreutils-perl liblocale-gettext-perl libnet-dbus-perl
libnet-pcap-perl libnet-rawip-perl libnet-ssleay-perl libpackage-stash-xs-perl libpadwalker-perl libparams-util-perl libpcsc-perl libproxy-tools libsocket6-perl libterm-readkey-perl libtext-charwidth-perl
libtext-iconv-perl libtext-soundex-perl libvlccore8 libxml-parser-perl mysql-common mysql-server perl perl-base phonon-backend-vlc vlc vlc-data vlc-nox vlc-plugin-notify vlc-plugin-samba
46 upgraded, 39 newly installed, 6 to remove and 583 not upgraded.
145 not fully installed or removed.
Need to get 0 B/46.4 MB of archives.
After this operation, 99.0 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Reading changelogs... Done
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 352471 files and directories currently installed.)
Preparing to unpack .../mysql-server-core-5.6_5.6.30-1_amd64.deb ...
Unpacking mysql-server-core-5.6 (5.6.30-1) ...
dpkg: error processing archive /var/cache/apt/archives/mysql-server-core-5.6_5.6.30-1_amd64.deb (--unpack):
trying to overwrite '/usr/share/man/man1/innochecksum.1.gz', which is also in package mysql-server-5.5 5.5.50-0+deb8u1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-core-5.6_5.6.30-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Bottom-up, the error is is:
trying to overwrite '/usr/share/man/man1/innochecksum.1.gz', which is also in package mysql-server-5.5 5.5.50-0+deb8u1
I've seen this mysql 5.5 / 5.6 dpkg error on other threads, but these were not answered by anyone.
I tried to remove mysql-server-5.5 (with --purge), but as mentioned earlier, each apt-get action I do leads to the dependencies issue mentioned above. Is this something I can solve using dpkg? Any advice on what to try?
Thanks for your lights !
Ok, nailed it.
I started by cleaning up the broken update
Then I commented out the 'rolling' repo and added as repo the legacy one:
I could then repair the mess by doing:
Then I re-enabled the new repo:
And finally...
That's it !