Please help me to solve sudo apt-get upgrade error
Linux MintThis forum is for the discussion of Linux Mint.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
sumit@sumit ~ $ sudo apt-get install gnuplot
[sudo] password for sumit:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
aglfn gnuplot-tex gnuplot5-data gnuplot5-qt liblua5.1-0
Suggested packages:
feedgnuplot gnuplot-doc libgnuplot-iostream-dev python-gnuplot gnuplot5-doc
The following NEW packages will be installed:
aglfn gnuplot gnuplot-tex gnuplot5-data gnuplot5-qt liblua5.1-0
0 upgraded, 6 newly installed, 0 to remove and 42 not upgraded.
3 not fully installed or removed.
Need to get 1,159 kB/1,459 kB of archives.
After this operation, 3,692 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 aglfn all 1.7-3 [29.4 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64 gnuplot-tex all 4.6.6-3 [10.1 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial/universe amd64 gnuplot5-data all 5.0.3+dfsg2-1 [59.3 kB]
Get:4 http://archive.ubuntu.com/ubuntu xenial/main amd64 liblua5.1-0 amd64 5.1.5-8ubuntu1 [102 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/universe amd64 gnuplot5-qt amd64 5.0.3+dfsg2-1 [951 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/universe amd64 gnuplot all 4.6.6-3 [6,970 B]
Fetched 1,159 kB in 4s (260 kB/s)
Selecting previously unselected package aglfn.
(Reading database ... 204807 files and directories currently installed.)
Preparing to unpack .../archives/aglfn_1.7-3_all.deb ...
Unpacking aglfn (1.7-3) ...
Selecting previously unselected package gnuplot-tex.
Preparing to unpack .../gnuplot-tex_4.6.6-3_all.deb ...
Unpacking gnuplot-tex (4.6.6-3) ...
Selecting previously unselected package gnuplot5-data.
Preparing to unpack .../gnuplot5-data_5.0.3+dfsg2-1_all.deb ...
Unpacking gnuplot5-data (5.0.3+dfsg2-1) ...
Selecting previously unselected package liblua5.1-0:amd64.
Preparing to unpack .../liblua5.1-0_5.1.5-8ubuntu1_amd64.deb ...
Unpacking liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Selecting previously unselected package gnuplot5-qt.
Preparing to unpack .../gnuplot5-qt_5.0.3+dfsg2-1_amd64.deb ...
Unpacking gnuplot5-qt (5.0.3+dfsg2-1) ...
Selecting previously unselected package gnuplot.
Preparing to unpack .../gnuplot_4.6.6-3_all.deb ...
Unpacking gnuplot (4.6.6-3) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Processing triggers for man-db (2.7.5-1) ...
dpkg: error processing package mate-menus (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of mozo:
mozo depends on mate-menus; however:
Package mate-menus is not configured yet.
dpkg: error processing package mozo (--configure):
dependency problems - leaving unconfigured
dpkg: error processing package python-apt (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
Setting up aglfn (1.7-3) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up gnuplot-tex (4.6.6-3) ...
Setting up gnuplot5-data (5.0.3+dfsg2-1) ...
Setting up liblua5.1-0:amd64 (5.1.5-8ubuntu1) ...
Setting up gnuplot5-qt (5.0.3+dfsg2-1) ...
update-alternatives: using /usr/bin/gnuplot5-qt to provide /usr/bin/gnuplot (gnuplot) in auto mode
update-alternatives: using /usr/bin/gnuplot5-qt to provide /usr/bin/gnuplot5 (gnuplot5) in auto mode
Setting up gnuplot (4.6.6-3) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
mate-menus
mozo
python-apt
E: Sub-process /usr/bin/dpkg returned an error code (1)
dpkg: error processing package python-apt (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
dpkg: error processing package python-apt (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
I am not able to figure out what to do. I am also not able to open system setting graphical interface,
you should reinstall it.
That is: apt-get install --reinstall python-apt
Am getting this:
Code:
sumit@sumit ~ $ sudo apt-get install --reinstall python-apt
[sudo] password for sumit:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
python-apt-dbg python-apt-doc
The following packages will be upgraded:
python-apt
1 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
3 not fully installed or removed.
Need to get 0 B/300 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
(Reading database ... 204908 files and directories currently installed.)
Preparing to unpack .../python-apt_1.1.0~beta1ubuntu0.16.04.1_amd64.deb ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing archive /var/cache/apt/archives/python-apt_1.1.0~beta1ubuntu0.16.04.1_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 1
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/python-apt_1.1.0~beta1ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I'll have to be honest with you, sumit 48. Usually when I see people with a problem such as yours, they go around in circles trying to solve it and eventually have to reinstall. Something has gone very awry with your Python setup. It probably is resolvable, but it could take a lot of nitty gritty complicated work to resolve it. Far easier to back up all your data to an external device and then reinstall the operating system.
Mint supports a great application called TimeShift which can be configured to take automatic snapshots of your system and allow you to roll back to a previous snapshot if things go wrong. I would advise you strongly to install this if you resolve the problem or reinstall Mint, and use it to minimise the damage if anything like this happens again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.