0

I'm updating a machine that was a little bit abandonned before and needed a massive update of its packages. The machine is an Ubuntu, and, after an apt update/upgrade, i get the following error:

carpette@carpette:~$ sudo apt clean
carpette@carpette:~$ 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:
     libpam-systemd : Depends: systemd (= 232-19)
     plymouth : Depends: systemd (>= 232-8~)
    E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
carpette@carpette:~$ sudo apt --fix-broken install
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Correcting dependencies... Done
    The following additional packages will be installed:
      systemd
    Suggested packages:
      systemd-ui systemd-container
    The following NEW packages will be installed:
      systemd
    0 upgraded, 1 newly installed, 0 to remove and 461 not upgraded.
    56 not fully installed or removed.
    Need to get 2466 kB of archives.
    After this operation, 9564 kB of additional disk space will be used.
    Do you want to continue? [Y/n] 
    Get:1 http://http.us.debian.org/debian testing/main amd64 systemd amd64 232-19 [2466 kB]
    Fetched 2466 kB in 1s (2170 kB/s) 
    (Reading database ... 61585 files and directories currently installed.)
    Preparing to unpack .../systemd_232-19_amd64.deb ...
    Unpacking systemd (232-19) ...
    dpkg: error processing archive /var/cache/apt/archives/systemd_232-19_amd64.deb (--unpack):
     trying to overwrite '/bin/loginctl', which is also in package systemd-services 204-5ubuntu20.24
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
    Errors were encountered while processing:
     /var/cache/apt/archives/systemd_232-19_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

As you can see, there are still a lot of packages to update, but i'm stuck with this systemd package. I don't really want to install it, i have no idea if it's necessary to get it or not, i just want to update the machine so it get updated to the latests releases.

The machine is currently running and apache2 daemon, mysql, and is used for multiple small websites. I can shutdown them for the time of the maintenance (if it's not too long)

Actually, this is the description of the machine:

carpette@carpette:~$ cat /etc/lsb-release 
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=14.04
    DISTRIB_CODENAME=trusty
    DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
3
  • 3
    You’ve somehow attempted to “upgrade” from Ubuntu 14.04 to Debian 9, which is unsupported and unlikely to work. Apr 4, 2017 at 10:39
  • 1
    Please add the content of your /eyc/apt/sources.list , @StephenKitt is right
    – GAD3R
    Apr 4, 2017 at 12:06
  • Thanks to you (StephenKitt, @GAD3R, and MichaelKjoörling), i found the problem. The machine had a testing.list file in /etc/apt/sources.list.d/ that was mentionning debian repository. I commented it, and it's working correctly now. Thx
    – Carpette
    Apr 4, 2017 at 12:24

1 Answer 1

5

As Stephen Kitt mentioned in a comment, it looks like you tried to upgrade the system from Ubuntu 14.04 to Debian Testing. That isn't going to work. The clue is in this line from your shell output:

    Get:1 http://http.us.debian.org/debian testing/main amd64 systemd amd64 232-19 [2466 kB]

See the http.us.debian.org there? That's not an Ubuntu repository location. systemd is one of the absolute core packages of the system. Whatever you tried to do, that's a tell-tale sign that what you did was the wrong thing to do.

My guess is that you added a Debian repository to your Ubuntu system's package manager configuration, and then attempted to perform an "upgrade", either implicitly or explicitly.

Your system is most likely currently in some mixture of states between Debian and Ubuntu. I would hazard a guess that it is unlikely to come back up if shut down or rebooted, at least not without major repairs.

While Ubuntu and Debian both use the Linux kernel, and both use similar packages, sidegrading (I hesitate to call it upgrading) a system from one to the other in-place is not a supported operation. Your best bet at this point is likely to take the important files from that system and migrate to a new system that is installed with your preferred Linux distribution.

It's possible that changing the package manager configuration back to an Ubuntu setup and performing an apt-get dist-upgrade might get the system back into a usable state, but then again doing so might also just make things even worse. Not only is Debian Testing currently likely to ship far newer package versions than any current Ubuntu release (let alone 14.04), but the package version upgrades may also have done things like rewritten configuration files. I'm not saying that this is impossible to repair in-place, but I am saying that it is almost certain to be far more trouble than it's worth. And, no offense intended, but if you fell into this trap, I have my doubts that you'd be able to dig your way out of it without significant hand-holding. In that case, calling for a helicopter rescue is the better option.

4
  • Nicely explained. dist-upgradeing back to Ubuntu would probably require pinning over 1000 to allow downgrades at this point (since Debian 9 is currently closer to Ubuntu 17.04 than to any released version of Ubuntu). Apr 4, 2017 at 11:02
  • @StephenKitt Yes, that's why I said it might make things worse rather than better. My preferred course of action at this point would be to migrate to a new installation.
    – user
    Apr 4, 2017 at 11:07
  • 1
    Agreed, I just thought it worth mentioning. Re-installing is the only safe option at this point. Apr 4, 2017 at 11:08
  • With you and what @StephenKitt said, i found the problem. The machine had a testing.list file in /etc/apt/sources.list.d/ that was mentionning debian repository. I commented it, and it's working correctly now. Thx
    – Carpette
    Apr 4, 2017 at 12:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .