2

I just upgraded to 18.04. Unfortunately during the update my laptop got stuck and restarted. After the restart everything seemed to work. A gig of updates later I got stuck on this problem. Apt dist-upgrade threw an error because of unmet dependencies and now I get the following Output when trying to fix it with apt --fix-broken install

    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:
      libkf5calendarcore5 libkf5libkdepim5abi1 libkf5pimcommon5abi2
    Use 'sudo apt autoremove' to remove them.
    The following additional packages will be installed:
      libkf5akonadicalendar5abi2 libkf5alarmcalendar-data
      libkf5alarmcalendar5abi1 libkf5mailtransport-data
      libkf5mailtransport5abi2
    The following packages will be REMOVED:
      kio-smtp libkf5alarmcalendar5
    The following NEW packages will be installed:
      libkf5akonadicalendar5abi2 libkf5alarmcalendar5abi1
      libkf5mailtransport5abi2
    The following packages will be upgraded:
      libkf5alarmcalendar-data libkf5mailtransport-data
    2 upgraded, 3 newly installed, 2 to remove and 10 not upgraded.
    41 not fully installed or removed.
    Need to get 0 B/584 kB of archives.
    After this operation, 743 kB of additional disk space will be used.
    Do you want to continue? [Y/n] y
    (Reading database ... 278631 files and directories currently installed.)
    Preparing to unpack .../libkf5mailtransport-data_17.12.3-0ubuntu4_all.deb ...
    Unpacking libkf5mailtransport-data (17.12.3-0ubuntu4) over (17.04.3-0ubuntu1) ...
    dpkg: error processing archive /var/cache/apt/archives/libkf5mailtransport-data_17.12.3-0ubuntu4_all.deb (--unpack):
     trying to overwrite '/etc/xdg/kmailtransport.categories', which is also in package kio-smtp 17.04.3-0ubuntu1
    dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
    Errors were encountered while processing:
     /var/cache/apt/archives/libkf5mailtransport-data_17.12.3-0ubuntu4_all.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is also the output of apt upgrade for completeness sake:

sudo 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:
 kde-config-mailtransport : Depends: libkf5mailtransport-data (= 17.12.3-0ubuntu4) but 17.04.3-0ubuntu1 is installed
                            Depends: libkf5mailtransport5abi2 (>= 17.07.70+git20170701) but it is not installed
 kdepim-runtime : Depends: libkf5akonadicalendar5abi2 (>= 4:17.07.70+git20170920.1507) but it is not installed
                  Depends: libkf5alarmcalendar5abi1 (>= 4:17.11.70+git20170926.0843) but it is not installed
                  Depends: libkf5mailtransport5abi2 (>= 17.07.70+git20170701) but it is not installed
 libkf5alarmcalendar5 : Depends: libkf5akonadicore5 (>= 4:15.12.0) but it is not installable
 libkf5mailtransportakonadi5 : Depends: libkf5mailtransport-data (= 17.12.3-0ubuntu4) but 17.04.3-0ubuntu1 is installed
                               Depends: libkf5mailtransport5abi2 (>= 17.07.70+git20170701) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

As I said this output was my main reason to even try apt --fix-broken install

As it turns out I just needed to remove kio-smtp package for this to work again. Since normal apt operations wouldn't work because of the unmet dependencies I did it with:

sudo dpkg -r --force-depends kio-smtp

to circumvent the dependency checks.

  • Welcome to Ask Ubuntu!. you have 2 upgraded, 3 newly installed, 2 to remove and 10 not upgraded. 41 not fully installed or removed before run the command sudo apt --fix-broken install try to run sudo apt update && sudo apt upgrade firstly. – abu-ahmed al-khatiri Dec 18 '18 at 08:44
  • Thanks for the welcome. I tried your suggestion. Didn't work, but I will update my question with the exact log. – Barbarian772 Dec 18 '18 at 08:59
  • the errors output appears cause you have The following packages were automatically installed and are no longer required: try to run sudo apt autoclean && sudo apt autoremove and then run sudo apt update && sudo dpkg --configure -a – abu-ahmed al-khatiri Dec 18 '18 at 09:22

1 Answers1

1

You are trying to install a new package libkf5mailtransport-data that contains a file that are allready installed in another package kio-smtp - see 7. last line in the --fix-broken output:

Unpacking libkf5mailtransport-data (17.12.3-0ubuntu4) over (17.04.3-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libkf5mailtransport-data_17.12.3-0ubuntu4_all.deb (--unpack):
 trying to overwrite '/etc/xdg/kmailtransport.categories', which is also in package kio-smtp 17.04.3-0ubuntu1

Two packages containing same files can not be installed at the same time. A quick-and-dirty hack would be to rename the offending file, and after the install check old and new file for differences. You might have to do this to get out of the current locked situation. But this will certainly give problems later.

As a permanent solution you might have to uninstall kio-smtp.

Soren A
  • 6,799
  • 1
    How can I uninstall it? Every action in apt leads to output similar to apt upgrade. telling me to do a --fix-broken install. I feel like I'm close to the point where a fresh install might be preferable. – Barbarian772 Dec 18 '18 at 09:38
  • @Barbarian772 using sudo apt-get purge --remove <package> – abu-ahmed al-khatiri Dec 18 '18 at 09:41
  • As I wrote rename the file /etc/xdg/kmailtransport.categories, run the --fix-broken command to get a clean install. Then uninstall kio-smtp, and rename the file back. – Soren A Dec 18 '18 at 09:42
  • @abu-ahmedal-khatiri you can't remove/purge anything before the existing conflicts are solved. – Soren A Dec 18 '18 at 09:44
  • yap! a voted for you!!! – abu-ahmed al-khatiri Dec 18 '18 at 09:59
  • 2
    Ok, thanks for your help, unfortunately simply renaming the file or removing it wasn't enough. What worked was removing the kio-smtp package like this: 'sudo dpkg -r --force-depends kio-smtp' – Barbarian772 Dec 18 '18 at 10:03