Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.




Question: Question: sudo apt-get update && sudo apt-get upgrade command is giving error

Nadia Baig
1782 days ago

Question: sudo apt-get update && sudo apt-get upgrade command is giving error

I get the following error when following command.

 sudo apt-get update && sudo apt-get upgrade

error:

Hit:1 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease
Hit:2 http://pk.archive.ubuntu.com/ubuntu xenial InRelease                     
Hit:3 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu xenial InRelease
Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease              
Hit:5 http://pk.archive.ubuntu.com/ubuntu xenial-updates InRelease             
Hit:6 http://pk.archive.ubuntu.com/ubuntu xenial-backports InRelease           
Hit:7 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease
Hit:8 http://ppa.launchpad.net/webupd8team/java/ubuntu xenial InRelease       
Hit:9 https://cran.rstudio.com/bin/linux/ubuntu xenial/ InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic ubuntu-minimal
The following packages will be upgraded:
  python3-jinja2
1 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
6 not fully installed or removed.
Need to get 0 B/113 kB of archives.
After this operation, 3,072 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 244953 files and directories currently installed.)
Preparing to unpack .../python3-jinja2_2.8-1ubuntu0.1_all.deb ...
/var/lib/dpkg/info/python3-jinja2.prerm: 6: /var/lib/dpkg/info/python3-jinja2.prerm: py3clean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/python3-jinja2_2.8-1ubuntu0.1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python3-jinja2.postinst: 6: /var/lib/dpkg/info/python3-jinja2.postinst: py3compile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/python3-jinja2_2.8-1ubuntu0.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
 Why is this so and how to fix it?

Answers
0

Probably the database got corrupted while installing a package. Reconfiguring often fixes the problem.

sudo dpkg --configure -a
sudo apt-get install -f
sudo apt remove  *carefully remove don’t do it for Linux Kernels (packages starting with linux-)

Thanks

 

Nadia Baig 1772 days ago

dpkg: error processing package python3 (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of apparmor:
 apparmor depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package apparmor (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-all:
 python3-all depends on python3 (= 3.5.1-3); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-all (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3-jinja2:
 python3-jinja2 depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package python3-jinja2 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent processing triggers for gnome-menus:
 gnome-menus depends on python3:any (>= 3.1~); however:
  Package python3 is not configured yet.

dpkg: error processing package gnome-menus (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for ufw:
 ufw depends on python3:any (>= 3.3.2-2~); however:
  Package python3 is not configured yet.

dpkg: error processing package ufw (--configure):
 dependency problems - leaving triggers unprocessed
dpkg: dependency problems prevent processing triggers for gconf2:
 gconf2 depends on python3:any; however:
  Package python3 is not configured yet.

dpkg: error processing package gconf2 (--configure):
 dependency problems - leaving triggers unprocessed
Errors were encountered while processing:
 python3
 apparmor
 python3-all
 python3-jinja2
 gnome-menus
 ufw
 gconf2

"first command sudo dpkg --configure -a" is giving me this error.

I guess I have messed up with the default python. Tried to reinstall it but no success.

Nadia Baig 1772 days ago