0

I am trying to fix the broken packages problem in my ubuntu pc.

when I try to audit my dpkg in terminal (sudo dpkg --audit ) I get....

The following packages are in a mess due to serious problems during
installation.  They must be reinstalled for them (and any packages
that depend on them) to function properly:

 apport               automatically generate crash reports for debugging

 libglib2.0-dev       Development files for the GLib library

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:

 appgrid              Discover and install apps for Ubuntu

mysql-server         MySQL database server (metapackage depending on the lates

 mysql-workbench-community MySQL Workbench

 python-ecdsa         ECDSA cryptographic signature library (Python 2)

 python-paramiko      Make ssh v2 connections with Python (Python 2)

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:

 mysql-server-5.7     MySQL database server binaries and system database setup

 python-mysql.connector pure Python implementation of MySQL Client/Server proto

 python-mysqldb       Python interface to MySQL

 python-ptyprocess    Run a subprocess in a pseudo terminal from Python 2

 python-pysqlite2     Python interface to SQLite 3

 python-six           Python 2 and 3 compatibility library (Python 2 interface)
George Udosen
  • 36,677

2 Answers2

0

As the messages already say, try to reinstall them. This can easily be done by just running

sudo apt install --reinstall [package name]

apt will then reinstall the packages, which should lead to dpkg not showing the packages in audit.

oliverjkb
  • 236
  • 1
  • 7
  • Preparing to unpack .../libglib2.0-dev_2.48.2-0ubuntu1_amd64.deb ... File "/usr/bin/pyclean", line 63 except (IOError, OSError), e: ^ SyntaxError: invalid syntax dpkg: warning: subprocess old pre-removal script returned error exit status 1 dpkg: trying script from the new package instead ... File "/usr/bin/pyclean", line 63 except (IOError, OSError), e: SyntaxError: invalid syntax dpkg: error processing archive /var/cache/apt/archives/libglib2.0-dev_2.48.2-0ubuntu1_amd64.deb (--unpack): subprocess new pre-removal script returned error exit 1 – user651691 Feb 07 '17 at 07:50
  • you should then proceed with this question – oliverjkb Feb 07 '17 at 08:01
  • Force installation hasn't solved my problem.. returns error again – user651691 Feb 07 '17 at 08:13
  • SyntaxError: invalid syntax dpkg: warning: subprocess old pre-removal script returned error exit status 1 dpkg: trying script from the new package instead ... File "/usr/bin/pyclean", line 63 except (IOError, OSError), e: – user651691 Feb 07 '17 at 08:23
0

Finally, my issue resolved

Reason for the issue (I was configured my phython as 3.5 instead of default 2.7). So, it affects libglib2.0

You can try to fix this by :

Executing the command ls -l /usr/bin/python and see it's output, if the file /usr/bin/python point to python3.x , then remove the link with the command sudo rm /usr/bin/python and use this one to create a link to python2 sudo ln -s /usr/bin/python2.7 /usr/bin/python. With this, python2.7 will be back as the default python version in your system.

And reinstalled broken packages using synaptic package manager. Everything works well now.