Since I was trying to install Java manually which I couldn't doing I have been having these errors while trying to install or update anything through terminal or update manager.
(Reading database ... 203927 files and directories currently installed.)
Removing jre1.8.0-51 (1.8.051-1) ...
find: `/usr/java/*': No such file or directory
/var/lib/dpkg/info/jre1.8.0-51.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing package jre1.8.0-51 (--remove):
subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
jre1.8.0-51
E: Sub-process /usr/bin/dpkg returned an error code (1)
i tried
sudo apt-get autoclean
sudo apt-get install --reinstall dpkg
sudo dpkg -P jre1.8.0-51
none of them worked , i always get that error at the end. can anyone help?