1

When I run my regular

$ sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove

I get

...
After this operation, 0 B of additional disk space will be used.
Setting up clamav-freshclam (0.103.2+dfsg-0ubuntu0.20.10.1) ...
Failed to reload daemon: Connection reset by peer
Failed to get unit file state for clamav-freshclam.service: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to retrieve unit state: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
clamav-freshclam.service is a disabled or a static unit not running, not starting it.
Failed to reload daemon: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to reload daemon: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to retrieve unit state: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to start clamav-freshclam.service: Connection timed out
See system logs and 'systemctl status clamav-freshclam.service' for details.
invoke-rc.d: initscript clamav-freshclam, action "start" failed.
Failed to get properties: Connection timed out
dpkg: error processing package clamav-freshclam (--configure):
 installed clamav-freshclam package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of clamav:
 clamav depends on clamav-freshclam (>= 0.103.2+dfsg) | clamav-data; however:
  Package clamav-freshclam is not configured yet.
  Package clamav-data is not installed.
  Package clamav-freshclam which provides clamav-data is not configured yet.

dpkg: error processing package clamav (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 clamav-freshclam
 clamav
E: Sub-process /usr/bin/dpkg returned an error code (1)

and while that looks like this question, the answers there are not helpful:

$ busctl | grep systemd1
org.freedesktop.systemd1                - -               -                (activatable) -                           -       -          

(after hard reboot, this line is not (activatable).)

$ systemctl daemon-reexec
$ sudo kill 1
$ busctl | grep systemd1
org.freedesktop.systemd1                - -               -                (activatable) -                           -       -          
$ systemctl --version
systemd 246 (246.6-1ubuntu1.3)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

So I can't restart it and the version is higher than 236 which had an issue.

How do I recover? In the current state, I can't logout or shutdown. I have to hard reset. And apt upgrade fails.

System Information

$ uname -a
Linux codex 5.8.0-49-generic #55-Ubuntu SMP Wed Mar 24 14:45:45 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/apt/sources.list.d/* | grep -v "^#"
deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/prod focal main
deb [arch=amd64] https://packages.microsoft.com/ubuntu/20.04/prod focal main
deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
deb [arch=amd64] https://updates.signal.org/desktop/apt xenial main
deb http://ppa.launchpad.net/ubuntuhandbook1/audacity/ubuntu focal main
$ cat /etc/apt/sources.list | grep -v "^#"
deb http://mirror.uchile.cl/ubuntu/ groovy main restricted
deb-src http://mirror.uchile.cl/ubuntu/ groovy restricted universe multiverse main #Added by software-properties
deb http://mirror.uchile.cl/ubuntu/ groovy-updates main restricted
deb-src http://mirror.uchile.cl/ubuntu/ groovy-updates restricted universe multiverse main #Added by software-properties
deb http://mirror.uchile.cl/ubuntu/ groovy universe
deb http://mirror.uchile.cl/ubuntu/ groovy-updates universe
deb http://mirror.uchile.cl/ubuntu/ groovy multiverse
deb http://mirror.uchile.cl/ubuntu/ groovy-updates multiverse
deb http://mirror.uchile.cl/ubuntu/ groovy-backports main restricted universe multiverse
deb-src http://mirror.uchile.cl/ubuntu/ groovy-backports main restricted universe multiverse #Added by software-properties
deb http://mirror.uchile.cl/ubuntu/ groovy-security main restricted
deb-src http://mirror.uchile.cl/ubuntu/ groovy-security restricted universe multiverse main #Added by software-properties
deb http://mirror.uchile.cl/ubuntu/ groovy-security universe
deb http://mirror.uchile.cl/ubuntu/ groovy-security multiverse

Apparently clamav is the culprit. Will poke them, too.

$ busctl | grep systemd1
org.freedesktop.systemd1                 1 systemd         root             :1.0          init.scope                  -       -          
$ sudo apt install clamav
...
Setting up clamav-base (0.103.2+dfsg-0ubuntu0.20.10.1) ...
uid=125(clamav) gid=134(clamav) groups=134(clamav)
Setting up clamav-freshclam (0.103.2+dfsg-0ubuntu0.20.10.1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/clamav-freshclam.service → /lib/systemd/system/clamav-freshclam.service.
Failed to reload daemon: Connection reset by peer
/usr/bin/deb-systemd-helper: error: systemctl preset failed on clamav-freshclam.service: No such file or directory
Failed to reload daemon: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to get unit file state for clamav-freshclam.service: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to retrieve unit state: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
clamav-freshclam.service is a disabled or a static unit, not starting it.
Failed to reload daemon: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to reload daemon: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
Failed to retrieve unit state: Connection timed out
Failed to start clamav-freshclam.service: Connection timed out
See system logs and 'systemctl status clamav-freshclam.service' for details.
invoke-rc.d: initscript clamav-freshclam, action "start" failed.
Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
dpkg: error processing package clamav-freshclam (--configure):
 installed clamav-freshclam package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of clamav:
 clamav depends on clamav-freshclam (>= 0.103.2+dfsg) | clamav-data; however:
  Package clamav-freshclam is not configured yet.
  Package clamav-data is not installed.
  Package clamav-freshclam which provides clamav-data is not configured yet.

dpkg: error processing package clamav (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (246.6-1ubuntu1.3) ...
Failed to reload daemon: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)
...
$ busctl | grep systemd1
org.freedesktop.systemd1                 - -               -                (activatable) -                           -       -          

This issue was reported to ClamAV, too.

Giszmo
  • 165
  • 1
  • 1
  • 8
  • What OS do you have installed? It seems the `apt full-upgrade` has broken your system. This happens often when you have customized your system outside of the package manager, for example by installing and using third party packages. https://embeddedinventor.com/apt-upgrade-vs-full-upgrade-differences-explained-for-beginners/ – paladin Apr 21 '21 at 16:24
  • Added system information. I did `sudo apt remove --purge clamav-base` as that's where the errors appeared but the system is broken for now until the next reboot at least :( – Giszmo Apr 21 '21 at 22:29
  • What is `systemctl status org.freedesktop.systemd1` telling you? – paladin Apr 22 '21 at 03:30
  • @paladin `Failed to get properties: Failed to activate service 'org.freedesktop.systemd1': timed out (service_start_timeout=25000ms)` – Giszmo Apr 22 '21 at 04:05
  • Use `ps aux --sort=-%mem` look for high memory consuming processes and try to deactivate (and maybe disable) their daemon/service (`kill PSID`, `systemctl stop DAEMON/SERVICE-NAME` and `systemctl disable DAEMON/SERVICE-NAME`. All in regard to your system RAM size. Use `htop` to make sure your RAM is not 100% full. Use `systemctl restart systemd-logind`. – paladin Apr 22 '21 at 05:35
  • I can now upgrade the system after purging freshclam but somehow the issue is not all fixed. The latest kernel doesn't let me login. Regarding memory, I have 32GB and also checked for free RAM during crashed systemd and there was plenty of RAM free, so no, I doubt it's RAM. – Giszmo Apr 22 '21 at 13:11
  • In my case, I was tring purge dbus and reinstalling it. Then I found dbus have unmet dependencies `fish` , then I purged fish and found systemd worked again. For people with same problem, purge and reinstall dbus could be a solution. Honestly I haven't figured out why and fish has been uninstalled. – Jay May 25 '22 at 07:23

0 Answers0