LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-30-2017, 02:04 AM   #1
thermal
LQ Newbie
 
Registered: Jan 2017
Distribution: Debian
Posts: 7

Rep: Reputation: 0
Question APT fix broken package error.


I need some help with this please, any tips will be much appreciated:

root@darkstar:/home/thermal# 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:
firebird2.5-common firebird2.5-common-doc firebird2.5-server-common firebird3.0-common firebird3.0-common-doc
fonts-mathjax gcc-4.9-doc gdebi-core gfortran-4.9-doc hardening-includes imagemagick-common libadns1 libappstreamqt1
libboost-chrono1.61.0 libboost-date-time1.61.0 libboost-filesystem1.61.0 libboost-iostreams1.61.0
libboost-program-options1.61.0 libboost-python1.61.0 libboost-random1.61.0 libboost-thread1.61.0 libchm1 libfbclient2
libfbembed2.5 libglew1.13 libjs-mathjax libjs-sphinxdoc libkf5gpgmepp5 libkf5kipi-bin libkwineffects8 libkwinglutils8
libkwinxrenderutils8 liblegacytaskmanager5 liblircclient0 liblivemedia52 libllvm3.8 libmagickcore-6.q16-2 libmsn0.3v5
libmysqlclient18 libpango1.0-0 libpodofo0.9.4 libpoppler61 libvncclient1 libx265-87 linux-image-4.6.0-1-amd64
linux-image-4.7.0-1-amd64 linux-image-4.8.0-1-amd64 mariadb-common python-apsw python-beautifulsoup python-bs4
python-cherrypy3 python-cssselect python-cssutils python-dateutil python-dnspython python-feedparser python-html5lib
python-libxml2 python-lxml python-markdown python-mechanize python-netifaces python-pygments python-pyparsing python-pyqt5
python-pyqt5.qtsvg python-pyqt5.qtwebkit python-repoze.lru python-routes python-sip python-utidylib python-webencodings
python-webob python-yaml vlc-nox
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-37-gtk2
The following packages will be upgraded:
libwebkit2gtk-4.0-37 libwebkit2gtk-4.0-37-gtk2
2 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
5 not fully installed or removed.
Need to get 0 B/19.0 MB of archives.
After this operation, 79.9 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "/usr/lib/python3.5/io.py", line 52, in <module>
File "/usr/lib/python3.5/abc.py", line 6, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 669, in exec_module
File "<frozen importlib._bootstrap_external>", line 773, in get_code
File "<frozen importlib._bootstrap_external>", line 484, in _compile_bytecode
EOFError: marshal data too short
Aborted
E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (1)
E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10
root@darkstar:/home/thermal#
 
Old 01-31-2017, 03:49 PM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Hi thermal, I'm just answering because no-one else has, although I have no special insight into the problem.

However, it looks as if it isn't apt that is not working, it's Python.

So, my first move if I were you would be to delete the Python cache (in case it has become corrupted) and see if that does the trick.

If this doesn't work then reinstalling Python 3.5 would probably be the next step.

If the above is alien-speak for you, let us know and someone can work through it with you.
 
1 members found this post helpful.
Old 02-04-2017, 11:52 PM   #3
erik2282
Member
 
Registered: May 2011
Location: Texas
Distribution: Primarily Deb/Ubuntu, and some CentOS
Posts: 829

Rep: Reputation: 229Reputation: 229Reputation: 229
Part of the output asks you to run a command. Have you ran it?

Quote:
Use 'apt autoremove' to remove them.
 
Old 02-06-2017, 01:18 AM   #4
thermal
LQ Newbie
 
Registered: Jan 2017
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hydrurga View Post
Hi thermal, I'm just answering because no-one else has, although I have no special insight into the problem.

However, it looks as if it isn't apt that is not working, it's Python.

So, my first move if I were you would be to delete the Python cache (in case it has become corrupted) and see if that does the trick.

If this doesn't work then reinstalling Python 3.5 would probably be the next step.

If the above is alien-speak for you, let us know and someone can work through it with you.
Thanks hydruga, I deleted the python cache but that didn't help.


When I try to reinstall python3 I get this:
Code:
root@darkstar:/home/thermal# apt-get install --reinstall python3
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:
 libwebkit2gtk-4.0-37 : Depends: libjavascriptcoregtk-4.0-18 (= 2.14.2-1) but 2.14.3-1 is to be installed
 python3 : PreDepends: python3-minimal (= 3.5.3-1) but 3.5.1-4 is to be installed
           Depends: libpython3-stdlib (= 3.5.3-1) but 3.5.1-4 is to be installed
It tries to downgrade python3 and libjavascriptcoregtk.

When I run apt-get -f install it aborts with the same python error I've been getting.


Quote:
Originally Posted by erik2282 View Post
Part of the output asks you to run a command. Have you ran it?
erik2282, yes, apt refuses to complete any install or uninstall task because of this issue with python.


My problem seems related to a reported bug in Debian testing and unstable: https://bugs.debian.org/cgi-bin/bugr...=no&bug=852163 "python3.5-minimal wont configure"

Got dependency hell going on.
 
Old 02-06-2017, 02:08 AM   #5
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
How did you manage to get into that state?

You're running testing? With no external sources (or mixed branches)?

Been a while since you upgraded?

Did you update the package lists before installing / upgrading stuff?

Quote:
My problem seems related to a reported bug in Debian testing and unstable: https://bugs.debian.org/cgi-bin/bugr...=no&bug=852163 "python3.5-minimal wont configure"
I wouldn't worry about that until you get your version numbers straight.

Last edited by descendant_command; 02-06-2017 at 02:11 AM.
 
Old 02-06-2017, 03:07 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Ok, let's see what you've got:

dpkg -l *python3* | grep -v ^un

Last edited by hydrurga; 02-06-2017 at 03:08 AM.
 
Old 02-06-2017, 03:36 AM   #7
thermal
LQ Newbie
 
Registered: Jan 2017
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
I am not sure how I got the system into this state. Perhaps because I played around with aptitude recently. (unaware that mixing use of the package-managers was not really a good idea.)
My last upgrade was a few weeks ago, after a much longer than normal for me delay. I always update the package index and install all recommended upgrades. Spotify is the only external source I have in my sources.list

Code:
root@darkstar:/home/thermal# cat /etc/apt/sources.list /etc/apt/sources.list.d/*

# deb cdrom:[Debian GNU/Linux stretch-DI-alpha4 _Stretch_ - Official Snapshot amd64 NETINST Binary-1 20151024-18:12]/ stretch contrib main non-free

# deb cdrom:[Debian GNU/Linux stretch-DI-alpha4 _Stretch_ - Official Snapshot amd64 NETINST Binary-1 20151024-18:12]/ stretch contrib main non-free

deb http://ftp.us.debian.org/debian/ stretch contrib main
deb-src http://ftp.us.debian.org/debian/ stretch main

deb http://security.debian.org/ stretch/updates main contrib non-free
deb http://http.us.debian.org/debian/ stretch non-free contrib main
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb http://repository.spotify.com stable non-free
 
Old 02-06-2017, 03:52 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by thermal View Post
I am not sure how I got the system into this state. Perhaps because I played around with aptitude recently. (unaware that mixing use of the package-managers was not really a good idea.)
My last upgrade was a few weeks ago, after a much longer than normal for me delay. I always update the package index and install all recommended upgrades. Spotify is the only external source I have in my sources.list

Code:
root@darkstar:/home/thermal# cat /etc/apt/sources.list /etc/apt/sources.list.d/*

# deb cdrom:[Debian GNU/Linux stretch-DI-alpha4 _Stretch_ - Official Snapshot amd64 NETINST Binary-1 20151024-18:12]/ stretch contrib main non-free

# deb cdrom:[Debian GNU/Linux stretch-DI-alpha4 _Stretch_ - Official Snapshot amd64 NETINST Binary-1 20151024-18:12]/ stretch contrib main non-free

deb http://ftp.us.debian.org/debian/ stretch contrib main
deb-src http://ftp.us.debian.org/debian/ stretch main

deb http://security.debian.org/ stretch/updates main contrib non-free
deb http://http.us.debian.org/debian/ stretch non-free contrib main
deb-src http://security.debian.org/ stretch/updates main contrib non-free
deb http://repository.spotify.com stable non-free
Using Synaptic shouldn't normally be a problem.

However you appear to have both:

deb http://ftp.us.debian.org/debian/ stretch contrib main

and

deb http://http.us.debian.org/debian/ stretch non-free contrib main

which doesn't look too good.

I'm not on a Debian system, so I can't verify which repos you should have as default (perhaps a Debian user will chime in), but https://wiki.debian.org/SourcesList indicates that you should have something along the lines of (ignoring the source repos for the moment):

deb http://ftp.us.debian.org/debian/ stretch main contrib non-free
deb http://ftp.us.debian.org/debian/ stretch-updates main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free

Last edited by hydrurga; 02-06-2017 at 03:54 AM.
 
1 members found this post helpful.
Old 02-06-2017, 04:16 AM   #9
thermal
LQ Newbie
 
Registered: Jan 2017
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
Modified my sources.list as per your suggestion.

Code:
root@darkstar:/home/thermal# dpkg -l *python3* | grep -v ^un
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version          Architecture Description
+++-=============================-================-============-===============================================================================
ii  libpython3-stdlib:amd64       3.5.1-4          amd64        interactive high-level object-oriented language (default python3 version)
ii  libpython3.4:amd64            3.4.4-3          amd64        Shared Python runtime library (version 3.4)
ii  libpython3.4-minimal:amd64    3.4.4-3          amd64        Minimal subset of the Python language (version 3.4)
ii  libpython3.4-stdlib:amd64     3.4.4-3          amd64        Interactive high-level object-oriented language (standard library, version 3.4)
ii  libpython3.5:amd64            3.5.3-1          amd64        Shared Python runtime library (version 3.5)
ii  libpython3.5-minimal:amd64    3.5.3-1          amd64        Minimal subset of the Python language (version 3.5)
ii  libpython3.5-stdlib:amd64     3.5.3-1          amd64        Interactive high-level object-oriented language (standard library, version 3.5)
ii  python3                       3.5.1-4          amd64        interactive high-level object-oriented language (default python3 version)
ii  python3-apt                   1.1.0~beta5      amd64        Python 3 interface to libapt-pkg
ii  python3-aptdaemon             1.1.1+bzr982-1   all          Python 3 modules for the server and client of aptdaemon
ii  python3-aptdaemon.gtk3widgets 1.1.1+bzr982-1   all          Python 3 GTK+ 3 widgets to run an aptdaemon client
ii  python3-brlapi                5.4-4            amd64        Braille display access via BRLTTY - Python3 bindings
ii  python3-cairo                 1.10.0+dfsg-5+b1 amd64        Python 3 bindings for the Cairo vector graphics library
ii  python3-chardet               2.3.0-2          all          universal character encoding detector for Python3
ii  python3-cups                  1.9.73-1         amd64        Python3 bindings for CUPS
ii  python3-cupshelpers           1.5.7-2          all          Python utility modules around the CUPS printing system
ii  python3-dbus                  1.2.4-1          amd64        simple interprocess messaging system (Python 3 interface)
ii  python3-debian                0.1.29           all          Python 3 modules to work with Debian-related data formats
ii  python3-debianbts             2.6.1            all          Python interface to Debian's Bug Tracking System
ii  python3-defer                 1.0.6-2          all          Small framework for asynchronous programming (Python 3)
ii  python3-gi                    3.22.0-2         amd64        Python 3 bindings for gobject-introspection libraries
ii  python3-httplib2              0.9.2+dfsg-1     all          comprehensive HTTP client library written for Python3
ii  python3-louis                 3.0.0-3          all          Python bindings for liblouis
ii  python3-minimal               3.5.1-4          amd64        minimal subset of the Python language (default python3 version)
ii  python3-pexpect               4.2.1-1          all          Python 3 module for automating interactive applications
ii  python3-pil:amd64             3.4.2-1          amd64        Python Imaging Library (Python3)
ii  python3-pkg-resources         33.1.1-1         all          Package Discovery and Resource Access using pkg_resources
ii  python3-ptyprocess            0.5.1-1          all          Run a subprocess in a pseudo terminal from Python 3
ii  python3-pyatspi               2.20.3+dfsg-1    all          Assistive Technology Service Provider Interface - Python3 bindings
ii  python3-pycurl                7.43.0-2         amd64        Python bindings to libcurl (Python 3)
ii  python3-pyqt5                 5.7+dfsg-4       amd64        Python 3 bindings for Qt5
ii  python3-pysimplesoap          1.16-2           all          simple and lightweight SOAP Library (Python 3)
ii  python3-renderpm:amd64        3.3.0-1+b1       amd64        python low level render interface
ii  python3-reportbug             7.1.2            all          Python modules for interacting with bug tracking systems
ii  python3-reportlab             3.3.0-1          all          ReportLab library to create PDF documents using Python3
ii  python3-reportlab-accel:amd64 3.3.0-1+b1       amd64        C coded extension accelerator for the ReportLab Toolkit
ii  python3-requests              2.12.4-1         all          elegant and simple HTTP library for Python3, built for human beings
ii  python3-sip                   4.18.1+dfsg-1    amd64        Python 3/C++ bindings generator runtime library
ii  python3-six                   1.10.0-3         all          Python 2 and 3 compatibility library (Python 3 interface)
ii  python3-smbc                  1.0.15.6-1       amd64        Python 3 bindings for the Samba client library
ii  python3-software-properties   0.96.20.2-1      all          manage the repositories that you install software from
ii  python3-speechd               0.8.6-1          all          Python interface to Speech Dispatcher
ii  python3-uno                   1:5.2.4-2        amd64        Python-UNO bridge
ii  python3-urllib3               1.19.1-1         all          HTTP library with thread-safe connection pooling for Python3
ii  python3-xdg                   0.25-4           all          Python 3 library to access freedesktop.org standards
ii  python3.4                     3.4.4-3          amd64        Interactive high-level object-oriented language (version 3.4)
ii  python3.4-minimal             3.4.4-3          amd64        Minimal subset of the Python language (version 3.4)
iU  python3.5                     3.5.3-1          amd64        Interactive high-level object-oriented language (version 3.5)
iF  python3.5-minimal             3.5.3-1          amd64        Minimal subset of the Python language (version 3.5)
 
Old 02-06-2017, 04:33 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
We need to figure out what can be done with the unpacked python3.5 package - if it were an ordinary package we could just remove it and try a reinstall, but so much of the system is dependent on python, we have to tread warily.

In the meantime, have you tried an update+upgrade since you changed the repos to see if that helps at all (at least with the dependencies situation)?
 
Old 02-06-2017, 04:34 AM   #11
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Maybe aptitude can help figure out a good way forward.
Dependency resolution is better than apt-get and running the ncurses interface lets you look around and try things.

FWIW, this can be a fairly common occurrence if you don't keep up with testing/sid.

Edit: disable spotify until you're fixed - don't know what packages it provides, but it's for stable, not testing so may introduce dependency conflicts with your system.

Last edited by descendant_command; 02-06-2017 at 04:39 AM.
 
Old 02-06-2017, 05:05 AM   #12
thermal
LQ Newbie
 
Registered: Jan 2017
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
Commented out Spotify.
I have run update and upgrade with apt-get as well as tried aptitude. Still throws a fatal python error with both.
 
Old 02-06-2017, 05:10 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I would say you need to reinstall python3.5, but you cannot because of this error.
Probably you can unpack the package and copy /usr/lib/python3.5/abc.py from the package, looks like this file was damaged (but probably there are others too).
Also try to remove *.pyc file(s) in that directory.
 
1 members found this post helpful.
Old 02-06-2017, 05:18 AM   #14
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Ok, my thoughts on this are as follows.

Firstly, you need to make a system backup/image. If you haven't been doing so, this is something you should be doing regularly - if so, it would have been reasonably easy to revert to a previous snapshot when this situation was first encountered.

Secondly, given that you appear to have both Python 3.4 and 3.5 installed, and 3.5 appears borked but the default, you might try changing the default Python to 3.4 and then running apt-get in the hope that it uses the good Python 3.4 and therefore allows us at least to use apt functionality.

The "Change python version system-wide" here: https://linuxconfig.org/how-to-chang...n-debian-linux might do the trick.

We're getting into "Here be dragons" territory, but as long as you have backed up the system, we can revert if things go awry. It's your call.
 
1 members found this post helpful.
Old 02-06-2017, 06:37 AM   #15
thermal
LQ Newbie
 
Registered: Jan 2017
Distribution: Debian
Posts: 7

Original Poster
Rep: Reputation: 0
pan64 I tried your suggestion, replaced both .py files complained about in the python error with fresh ones from the version-equivalent package - no joy.

hydrurga, my default python was set to 2.7 already but I went ahead and setup the system-wide alternatives as in that link you posted. apt still insists on running the 3.5 (and erroring out)

I'm going to throw in the towel on this and just re-image my system (sometime soon).

Thanks all of you very much, you've provided amazing assistance.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fix broken package joboy Ubuntu 20 04-13-2017 06:15 AM
how to fix broken package nickole Linux - Newbie 4 11-07-2014 03:27 PM
how to fix a broken package nuris Linux - Newbie 5 07-21-2012 03:25 PM
Warning--Icedove 2.0.0.0-3 package broken (+fix) David the H. Debian 1 05-25-2007 09:25 AM
Aptitude--How to fix broken package kkruecke Debian 1 08-29-2006 03:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration