1

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?

David Foerster
  • 35,754
  • 55
  • 92
  • 145
Boris L
  • 31
  • 3
  • How did you install Java? – A.B. Jul 23 '15 at 12:53
  • i installed by downloading the rpm file on oracle page, used the alien command to extract the rpm file and the dpkg -i commando to install the deb file. but i found the solution now, just removed the file which was giving error: /var/lib/dpkg/info/jre1.8.0-51.postrm //// its working fine now, but thanks for answering me. – Boris L Jul 23 '15 at 18:28
  • Good idea, write an answer. You have my upvote. – A.B. Jul 23 '15 at 18:29
  • 1
    Possible duplicate of [Cannot remove JDK – /usr/sbin/alternatives: No such file or directory](http://askubuntu.com/questions/597015/cannot-remove-jdk-usr-sbin-alternatives-no-such-file-or-directory) – David Foerster Apr 01 '16 at 03:50

1 Answers1

2

Just removed the file which was giving error.

sudo rm /var/lib/dpkg/info/jre1.8.0-51.postrm

That is no problem, because I want to remove the package anyway.

A.B.
  • 89,123
  • 21
  • 245
  • 323
Boris L
  • 31
  • 3