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 .
sudo apt-get -f install
works fine butsudo dpkg --audit
doesn't return anything to the terminal. – Samuel Mideksa May 07 '19 at 08:19sudo apt update
aftersudo apt -f install
? Still you cannot dosudo apt update
normally? – MR. ROBOT May 07 '19 at 08:39sudo apt-get update
aftersudo apt-get -f install
and it still can't update properly with the above error message. Butsudo apt-get -f install
works fine. – Samuel Mideksa May 07 '19 at 09:18if /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 07 '19 at 14:25false
to the terminal. And there is no/dev/null
in my home directory. – Samuel Mideksa May 08 '19 at 06:53ls -l /var/lib/command-not-found/
and tell me if you have/usr/lib/cnf-update-db
– MR. ROBOT May 08 '19 at 07:08ls -l /var/lib/command-not-found/
returnstotal 0
andcd /usr/lib/cnf-update-db
and the commandbash: cd: /usr/lib/cnf-update-db: Not a directory
returnsbash: cd: /usr/lib/cnf-update-db: Not a directory
. – Samuel Mideksa May 08 '19 at 07:14cnf-update-db
is a file. So you can get to know if it exists or not bycat /usr/lib/cnf-update-db
– MR. ROBOT May 08 '19 at 07:18ls -l /var/lib/ | grep 'command-not-found'
notls -l /var/lib/command-not-found/
. Sorry. – MR. ROBOT May 08 '19 at 07:23drwxr-xr-x 2 root root 4096 ኤፕረ 24 2018 command-not-found
to the command line. – Samuel Mideksa May 08 '19 at 07:35cat /usr/lib/cnf-update-db
? It said that there is no file? – MR. ROBOT May 08 '19 at 07:37sudo chmod a+w /var/lib/command-not-found/
andsudo apt update
. – MR. ROBOT May 08 '19 at 09:01sudo chmod a+w /var/lib/command-not-found/
do? The same errorE: 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
is getting printed to the terminal. Do I have to delete the file/var/lib/command-not-found/
after changing mode? – Samuel Mideksa May 08 '19 at 09:54if /usr/bin/test -w /var/lib/command-not-found/ -a -e /usr/lib/cnf-update-db; then echo 'true'; else echo 'false';fi
? if the answer is yes, it means you need to make the file/dev/null
manually bytouch /dev/null
. And then trysudo apt update
again. – MR. ROBOT May 08 '19 at 10:01true
. The second goes fine but theapt-get update
is not working due to some issues. – Samuel Mideksa May 08 '19 at 10:28if /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
on a terminal please. If there is no error during it, it means a error exists somewhere else. – MR. ROBOT May 08 '19 at 11:34bash: /usr/lib/cnf-update-db: /usr/bin/python3: bad interpreter: No such file or directory
– Samuel Mideksa May 08 '19 at 11:40bash: /usr/lib/cnf-update-db: /usr/bin/python3: bad interpreter: No such file or directory
– Samuel Mideksa May 08 '19 at 12:33sudo apt install python3
– MR. ROBOT May 08 '19 at 12:54sudo apt-get install python3
works without an error. but when I typepython3 --version
It is raising the above errorbash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
– Samuel Mideksa May 09 '19 at 07:09sudo rm ~/Anaconda3
and removed the line invoking conda in .bashrc file. Was that causing the problem? – Samuel Mideksa May 09 '19 at 07:11sudo apt remove --purge python3
and then reinstall it bysudo apt install python3
. I hope this solve the problem. – MR. ROBOT May 09 '19 at 07:22E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). The purge also didn't succeed with the following error
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution). ` – Samuel Mideksa May 09 '19 at 07:26sudo apt --fix-broken install
– MR. ROBOT May 09 '19 at 07:27sudo apt --fix-broken install python3
but it is not workingE: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
– Samuel Mideksa May 09 '19 at 07:30sudo apt-get check
– MR. ROBOT May 09 '19 at 11:03