0

I am using ubuntu 18.04. When I try to run sudo apt-get update I am getting the following error. Can anybody try to help me solve this problem?

E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then /usr/lib/cnf-update-db > /dev/null; fi

E: Sub-process returned an error code

Following this when I try to run sudo apt-get update It completed successfully .

0

1 Answer 1

0

First try

sudo apt-get -f install

If this does not help you, then try the following.

Check which package causing the problem by this command.

sudo dpkg --audit

Then reinstall or reconfigure it.

31
  • sudo apt-get -f install works fine but sudo dpkg --audit doesn't return anything to the terminal. May 7, 2019 at 8:19
  • Did you try sudo apt update after sudo apt -f install? Still you cannot do sudo apt update normally?
    – MR. ROBOT
    May 7, 2019 at 8:39
  • yes I tried sudo apt-get update after sudo apt-get -f install and it still can't update properly with the above error message. But sudo apt-get -f install works fine. May 7, 2019 at 9:18
  • Tell me the result of this script on on a terminal if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then echo 'true'; else echo 'false'; fi And tell if you have /dev/null
    – MR. ROBOT
    May 7, 2019 at 14:25
  • The above command prints false to the terminal. And there is no /dev/null in my home directory. May 8, 2019 at 6:53

Not the answer you're looking for? Browse other questions tagged .