M HYPE SPLASH
// news

I by mistake deleted usr/share/java in ubuntu16..04. How to fix it?

By Emma Payne

By mistake I have deleted usr/share/java. How to fix it?

1

1 Answer

If you had (parts of) a Java installation at /usr/share/java* that means you installed Java through the package manager. There are a few independent Java packages available in Ubuntu and I don't know which one(s) you installed because you don't tell us. However you can reinstall any package with

sudo apt install --reinstall <PACKAGE...>

to restore missing or corrupted files.

You can find out which files of all installed packages ought to reside in /usr/share/java and their respective packages with:

dpkg-query -S /usr/share/java

You can even use the result of that command to install all of the listed packages right away:

dpkg-query -S /usr/share/java | sed -e 's/:.*$//;s/, /\n/g' | xargs -rd '\n' -- sudo apt install --reinstall

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy