python2.7: can't open file '/usr/lib/python2.7/py_compile.py'

3

I'm getting lot's of error with apt-get. I've tried to install package manualy but everything seems stucked.

mio@vm:~$ sudo apt-get install --reinstall python2.7-minimal
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reinstallation of python2.7-minimal is not possible, it cannot be downloaded.
The following packages were automatically installed and are no longer required:
  aspell-en libkdc2-heimdal libroken18-heimdal aspell libhdb9-heimdal libpython2.7 libtdb1 libasn1-8-heimdal libgssapi3-heimdal tdb-tools libwind0-heimdal libenchant1c2a libtevent0 libhcrypto4-heimdal
  libhx509-5-heimdal libheimbase1-heimdal libhunspell-1.3-0 libldb1 libheimntlm0-heimdal libaspell15 libkrb5-26-heimdal
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up python2.7-minimal (2.7.5-8) ...
python2.7: can't open file '/usr/lib/python2.7/py_compile.py': [Errno 2] No such file or directory
dpkg: error processing python2.7-minimal (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up mysql-server-5.5 (5.5.33+dfsg-1) ...
configured to not write apport reports
[ ok                                  [....] Stopping MySQL database server: mysqld.
Usage: /etc/init.d/mongod {start|stop|force-stop|restart|force-reload|status}
insserv: warning: script 'mongodb' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `mongodb'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `mongodb'
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      Setting up mongodb-10gen (2.4.8) ...
[FAIL] Starting database: mongod failed!
invoke-rc.d: initscript mongodb, action "start" failed.
dpkg: error processing mongodb-10gen (--configure):
 subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
                                      dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.5; however:
  Package mysql-server-5.5 is not configured yet.

dpkg: error processing mysql-server (--configure):
 dependency problems - leaving unconfigured
configured to not write apport reports
                                      Errors were encountered while processing:
 python2.7-minimal
 mysql-server-5.5
 mongodb-10gen
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

For Python2.7-minimal i've tried

apt-get install --reinstall python2.7-minimal

Without success. All command like

apt-get clean apt-get -f install

Return the same.

Any help will be realy appreciated for python, also for other packages too.

Mio

Posted 2013-11-12T14:54:39.790

Reputation: 173

What's the output of 'apt-get check'? – rickhg12hs – 2013-11-12T20:07:53.930

@rickhg12hs : `> apt-get checkReading package lists... Done

Building dependency tree Reading state information... Done`

– Mio – 2013-11-13T14:40:23.333

What's the output of 'apt-get update'? – rickhg12hs – 2013-11-13T15:33:46.760

@rickhg12hs Hit http://downloads-distro.mongodb.org dist Release.gpg Hit ...... Reading package lists... Done

– Mio – 2013-11-18T11:29:39.147

@rickhg12hs no error on apt-get update – Mio – 2013-11-18T11:29:55.227

Strange, but good no errors. Would you mind doing an 'apt-get upgrade'? – rickhg12hs – 2013-11-18T15:43:16.223

@rickhg12hs i get nearly the same as on my main question. Finishing with Errors were encountered while processing: python2.7-minimal mysql-server-5.5 mongodb-10gen mysql-server E: Sub-process /usr/bin/dpkg returned an error code (1) – Mio – 2013-11-19T14:40:42.407

What does 'dpkg -C' show? – rickhg12hs – 2013-11-19T16:04:14.583

@rickhg12hs The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: mysql-server MySQL database server (metapackage depending on the lates – Mio – 2013-11-20T16:21:54.933

@rickhg12hs The following packages are only half configured, probably due to problems configuring them the first time. The configuration should be retried using dpkg --configure <package> or the configure menu option in dselect: mongodb-10gen An object/document-oriented database python2.7-minimal Minimal subset of the Python language (version 2.7) mysql-server-5.5 MySQL database server binaries and system database setup – Mio – 2013-11-20T16:22:10.293

@rickhg12hs The following packages are missing the md5sums control file in the database, they need to be reinstalled: dhcp3-client ISC DHCP server (transitional package) bin86 16-bit x86 assembler and loader dhcp3-common ISC DHCP common files (transitional package) – Mio – 2013-11-20T16:22:41.530

@rickhg12hs but i try to do it one by one with dpkg --configure <package> i'm getting exactly the same errors as for apt-get upgrade – Mio – 2013-11-20T16:24:22.100

Did you try the recommended reinstalls? – rickhg12hs – 2013-11-20T17:34:14.500

Answers

0

I've nearly found and issue with help found here http://ubuntuforums.org/showthread.php?t=1763604&page=3.

Simply doing dpkg -P --force depends <packages who fail>

More infos about this arguments : http://tipstricks.itmatrix.eu/?p=755

And after install it with aptitude sudo aptitude install mysql-server-5.1

Not the cleanest way, but no more errors !

Mio

Posted 2013-11-12T14:54:39.790

Reputation: 173

1

After ubuntu 16.04 -> 18.04 upgrade I had an issue with pyhon3.7 libs missing, whole apt/dpkg was blocked. Luckily found missing /usr/lib/python3.7/py_compile.py one level deeper /usr/local/lib/python3.7. Solution which worked for me was backup (rename) whole /usr/lib/python3.7 and replace with sym-link.

Nastavuje se balík python3-tk:amd64 (3.6.5-3) …
(null): can't open file '/usr/lib/python3.7/py_compile.py': [Errno 2] No such file or directory
dpkg: chyba při zpracovávání balíku python3-tk:amd64 (--configure):
 installed python3-tk:amd64 package post-installation script subprocess returned error exit status 2
Nastavuje se balík python3-lib2to3 (3.6.5-3) …
(null): can't open file '/usr/lib/python3.7/py_compile.py': [Errno 2] No such file or directory
dpkg: chyba při zpracovávání balíku python3-lib2to3 (--configure):
 installed python3-lib2to3 package post-installation script subprocess returned error exit status 2
...

czechDude

Posted 2013-11-12T14:54:39.790

Reputation: 11