This last weed-end, I tried to upgrade my old Bodhi Linux 2.4 based on Ubuntu 12.04 LTS to Bodhi 3.0 based on Ubuntu 14.04 LTS.
At some point something goes wrong with the update of the 1500 or so packages. I’m not sure about what happenned, but I started to see stranges errors, especially when trying to install/remove/correct package, but also in other part, for example when running some Python3 scripts.
Finally, everything was looking like working, but just almost working. Google fails on me on that, and I spend quite some time this week-end trying to go to the bottom of that problem, so I let a testimonial here, if it can help other people.
Symptoms
Segmentation fault (core dumped) with apt-get and python3 related scripts
This appears especially when trying to install/install -f «update-notifier-common» software, for example (sorry for the French):
% sudo apt-get install -f
Lecture des listes de paquets… Fait
Construction de l’arbre des dépendances
Lecture des informations d’état… Fait
0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour.
1 partiellement installés ou enlevés.
Après cette opération, 0 o d’espace disque supplémentaires seront utilisés.
Paramétrage de update-notifier-common (0.154.1) …
Segmentation fault (core dumped)
dpkg: error processing package update-notifier-common (—configure):
le sous-processus script post-installation installé a retourné une erreur de sortie d’état 139
Des erreurs ont été rencontrées pendant l’exécution :
update-notifier-common
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)
The other aspect of that problem was that any Python3 related errors lead to a stack trace like that:
% python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type «help», «copyright», «credits» or «license» for more information.
>>> foo
Traceback (most recent call last):
File «», line 1, in
NameError: name ‘foo’ is not defined
Error in sys.excepthook:
Traceback (most recent call last):
File «/usr/lib/python3/dist-packages/apport_python_hook.py», line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File «/usr/lib/python3/dist-packages/apport/__init__.py», line 5, in
from apport.report import Report
File «/usr/lib/python3/dist-packages/apport/report.py», line 30, in
import apport.fileutils
File «/usr/lib/python3/dist-packages/apport/fileutils.py», line 23, in
from apport.packaging_impl import impl as packaging
File «/usr/lib/python3/dist-packages/apport/packaging_impl.py», line 20, in
import apt
File «/usr/lib/python3/dist-packages/apt/__init__.py», line 23, in
import apt_pkg
ImportError: /usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so: undefined symbol: _ZN13pkgTagSectionC1Ev
Original exception was:
Traceback (most recent call last):
File «
«, line 1, in
NameError: name ‘foo’ is not defined
Error: Timeout was reached
The second main symptom was that when using apt-* tools, I was getting an error message «Error: Timeout was reached» just at the end of the process. Nonetheless, everything seemed to be correctly installed/removed/etc.
Bug tracking, short version
That led me to some bug about a timeout to short for packagekit:
/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call —system —dest org.freedesktop.PackageKit —object-path /org/freedesktop/PackageKit —timeout 4 —method org.freedesktop.PackageKit.StateHasChanged cache-update
So I tested with a really big number, and got:
/usr/bin/gdbus call —system —dest org.freedesktop.PackageKit —object-path /org/freedesktop/PackageKit —timeout 300 —method org.freedesktop.PackageKit.StateHasChanged cache-update
Error: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.PackageKit timed out
What lead to testing packagkit itself:
% sudo /usr/lib/packagekit/packagekitd —verbose
11:12:57 PackageKit Verbose debugging enabled (on console 1)
11:12:57 PackageKit keep_environment: 0
11:12:57 PackageKit using config file ‘/etc/PackageKit/PackageKit.conf’
11:12:57 PackageKit syslog fucntionality disabled
11:12:57 PackageKit Log all transactions: 1
11:12:57 PackageKit daemon shutdown set to 300 seconds
11:12:57 PackageKit clearing download cache at /var/cache/PackageKit/downloads
11:12:57 PackageKit destination eth0 is valid
11:12:57 PackageKit setting config file watch on /etc/PackageKit/PackageKit.conf
11:12:57 PackageKit ProxyHTTP read error: Key file does not have key ‘ProxyHTTP’
11:12:57 PackageKit searching for plugins in /usr/lib/x86_64-linux-gnu/packagekit-plugins
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-systemd-updates.so: A plugin to write the prepared-updates file
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-clear-firmware-requests.so: Clears firmware requests
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-check-shared-libraries-in-use.so: checks for any shared libraries in use after a security update
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-scan-desktop-files.so: Scans desktop files on refresh and adds them to a database
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-update-check-processes.so: Checks for running processes during update for session restarts
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-no-update-process.so: Updates the package lists after refresh
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-update-package-cache.so: Maintains a database of all packages for fast read-only access to package information
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin_scripts.so: Runs external scrips
11:12:57 PackageKit opened plugin /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-require-restart.so: A dummy plugin that doesn’t do anything
11:12:57 PackageKit run pk_plugin_initialize on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-check-shared-libraries-in-use.so
11:12:57 PackageKit finished pk_plugin_initialize
11:12:57 PackageKit run pk_plugin_initialize on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-scan-desktop-files.so
11:12:57 PackageKit finished pk_plugin_initialize
11:12:57 PackageKit run pk_plugin_initialize on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-update-check-processes.so
11:12:57 PackageKit finished pk_plugin_initialize
11:12:57 PackageKit run pk_plugin_initialize on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-no-update-process.so
11:12:57 PackageKit finished pk_plugin_initialize
11:12:57 PackageKit run pk_plugin_initialize on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-update-package-cache.so
11:12:57 PackageKit finished pk_plugin_initialize
11:12:57 PackageKit run pk_plugin_initialize on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-require-restart.so
11:12:57 PackageKit finished pk_plugin_initialize
11:12:57 PackageKit Trying to load : aptcc
11:12:57 PackageKit dlopening ‘/usr/lib/x86_64-linux-gnu/packagekit-backend/libpk_backend_aptcc.so’
Failed to load the backend: opening module aptcc failed : /usr/lib/x86_64-linux-gnu/packagekit-backend/libpk_backend_aptcc.so: undefined symbol: _ZN13pkgTagSectionC1Ev11:12:57 PackageKit run pk_plugin_destroy on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-check-shared-libraries-in-use.so
11:12:57 PackageKit finished pk_plugin_destroy
11:12:57 PackageKit run pk_plugin_destroy on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-scan-desktop-files.so
11:12:57 PackageKit finished pk_plugin_destroy
11:12:57 PackageKit run pk_plugin_destroy on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-update-check-processes.so
11:12:57 PackageKit finished pk_plugin_destroy
11:12:57 PackageKit run pk_plugin_destroy on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-no-update-process.so
11:12:57 PackageKit finished pk_plugin_destroy
11:12:57 PackageKit run pk_plugin_destroy on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-update-package-cache.so
11:12:57 PackageKit finished pk_plugin_destroy
11:12:57 PackageKit run pk_plugin_destroy on /usr/lib/x86_64-linux-gnu/packagekit-plugins/libpk_plugin-require-restart.so
11:12:57 PackageKit finished pk_plugin_destroy
11:12:57 PackageKit already closed (nonfatal)
11:12:57 PackageKit parent_class->finalize
HooooOOoo… What about Aptitude ?
% aptitude
aptitude: symbol lookup error: aptitude: undefined symbol: _ZN3APT11CacheFilter39PackageArchitectureMatchesSpecificationC1ERKSsb
Solution
The problem was that somehow, I get a bad version of libapt-pkg4.12. So anything related to apt in some way had a chance to end badly.
Reinstalling the correct version of them (the one provided with my distribution) corrected all the problems:
sudo apt-get install libapt-pkg4.12=1.1.1bodhi1 apt=1.1.1bodhi1 apt-transport-https=1.1.1bodhi1 apt-utils=1.1.1bodhi1
Hope it helps !
-
4joeyirosh1
- Posts: 154
- Joined: 2016-09-11 18:04
- Been thanked: 3 times
Re: Error: Timeout was reached when running apt update && apt upgrade
#3
Post
by 4joeyirosh1 » 2022-03-16 20:01
arochester wrote: ↑2022-03-16 19:36
What does your sources list say?
My repos placed on the /etc/apt/sources.list file as as below
Code: Select all
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian-debug/ bullseye-debug main
deb http://deb.opera.com/opera-stable/ stable non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://httpredir.debian.org/debian/ bullseye main contrib non-free
deb https://download.virtualbox.org/virtualbox/debian buster contrib
deb https://dl.winehq.org/wine-builds/debian/ bullseye main
deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_11 ./
Output of apt update && apt upgrade is as below
Code: Select all
apt update && apt upgrade
Hit:1 https://brave-browser-apt-release.s3.brave.com stable InRelease
Hit:2 http://security.debian.org/debian-security bullseye-security InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Hit:4 http://deb.debian.org/debian-security bullseye-security InRelease
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:6 http://httpredir.debian.org/debian bullseye InRelease
Hit:7 https://dl.winehq.org/wine-builds/debian bullseye InRelease
Hit:8 http://deb.debian.org/debian bullseye-updates InRelease
Hit:10 https://repo.skype.com/deb stable InRelease
Hit:11 https://repo.protonvpn.com/debian stable InRelease
Hit:12 http://deb.debian.org/debian-debug bullseye-debug InRelease
Hit:13 https://packages.microsoft.com/repos/ms-teams stable InRelease
Hit:14 https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_11 ./ InRelease
Hit:15 http://dl.google.com/linux/earth/deb stable InRelease
Hit:9 https://deb.opera.com/opera-stable stable InRelease
Hit:16 https://download.virtualbox.org/virtualbox/debian buster InRelease
Error: Timeout was reached
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I’m in a difficult situation.
Using Debian Jessie / Stretch, apt-get -f install
fails.
The system is effectively stuck. I’ve sshed in now. As far as login terminals, only one was becoming available. (Namely, only alt-ctrl-F1 brought up a login terminal on the actual machine, alt-ctrl-f[2-5] failed).
It seems to be related to the bug listed here. Though there are multiple problems: krb-kdc doesn’t unpack because PolicyKit timeout was reached (g-io-error-quark, 24)
, then errors unpacking krb5-admin-server, the an error message that LDAP must be enabled (though it is and connects fine).
Namely, there are multiple time-outs with apt-get (to PolicyKit bits it seems). As far as the network, I’ve set the timeout time to 1200, with no seeming effect.
The full error message:
The following extra packages will be installed:
krb5-admin-server krb5-kdc
Suggested packages:
openbsd-inetd inet-superserver krb5-kdc-ldap
The following packages will be upgraded:
krb5-admin-server krb5-kdc
2 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
9 not fully installed or removed.
Need to get 0 B/320 kB of archives.
After this operation, 115 kB disk space will be freed.
Do you want to continue? [Y/n]
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 296869 files and directories currently installed.)
Preparing to unpack .../krb5-kdc_1.13.2+dfsg-2_amd64.deb ...
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to stop krb5-kdc.service: Connection timed out
Failed to get load state of krb5-kdc.service: Connection timed out
invoke-rc.d: initscript krb5-kdc, action "stop" failed.
failed to stop krb5-kdc
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to stop krb5-kdc.service: Connection timed out
Failed to get load state of krb5-kdc.service: Connection timed out
invoke-rc.d: initscript krb5-kdc, action "stop" failed.
failed to stop krb5-kdc
dpkg: error processing archive /var/cache/apt/archives/krb5-kdc_1.13.2+dfsg-2_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to start krb5-kdc.service: Connection timed out
invoke-rc.d: initscript krb5-kdc, action "start" failed.
Preparing to unpack .../krb5-admin-server_1.13.2+dfsg-2_amd64.deb ...
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to stop krb5-admin-server.service: Connection timed out
Failed to get load state of krb5-admin-server.service: Connection timed out
invoke-rc.d: initscript krb5-admin-server, action "stop" failed.
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached (g-io-error-quark, 24)
Failed to execute operation: Connection timed out
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: GDBus.Error:org.freedesktop.DBus.Error.TimedOut: Activation of org.freedesktop.PolicyKit1 timed out (g-dbus-error-quark, 20)
Failed to stop krb5-admin-server.service: Connection timed out
Failed to get load state of krb5-admin-server.service: Connection timed out
invoke-rc.d: initscript krb5-admin-server, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/krb5-admin-server_1.13.2+dfsg-2_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
insserv: Service ldap has to be enabled to start service krb5-admin-server
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/krb5-kdc_1.13.2+dfsg-2_amd64.deb
/var/cache/apt/archives/krb5-admin-server_1.13.2+dfsg-2_amd64.deb
Error: Timeout was reached
E: Sub-process /usr/bin/dpkg returned an error code (1)
Questions:
- What else can I do to force
apt-get -f install
? - Would it help to force a roll-back to Jessie?