Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove broken java installation (linux)

Tags:

linux

apt-get

I somehow messed up my Java installation and now I get this:

$ sudo apt-get remove jre1.8.0_66
(Reading database ... 55212 files and directories currently installed.)
Removing jre1.8.0-65 ...
find: `/usr/java/*': No such file or directory
/var/lib/dpkg/info/jre1.8.0-65.postrm: line 586: /usr/sbin/alternatives: No such file or directory
dpkg: error processing jre1.8.0-65 (--remove):
 subprocess installed post-removal script returned error exit status 127
Errors were encountered while processing:
 jre1.8.0-65
E: Sub-process /usr/bin/dpkg returned an error code (1)

How can I force to remove this? The folder with the java files is empty, but this shows up everytime i install something...

EDIT: Linux says it's half installed/removed:

0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
like image 564
user3088126 Avatar asked Nov 10 '15 16:11

user3088126


1 Answers

/usr/sbin/alternatives: No such file or directory

There is no /usr/sbin/alternatives in Debian, Ubuntu, or their clones. Instead, there is /usr/bin/update-alternatives.

I suggest a temporary symbolic link to work around the badly converted RPM package:

mkdir -p /usr/sbin
ln -s /usr/bin/update-alternatives /usr/sbin/alternatives
like image 113
Knud Larsen Avatar answered Oct 15 '22 05:10

Knud Larsen