Upgrading to Ubuntu 14.04: "Error: Timeout was reached", "Segmentation fault (core dumped)" with APT and other stranges errors
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 "
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 "
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 !