Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 10.04. I've accidentally deleted the jni folder in /usr/lib/ by using the root terminal.

Is there any way that I can reinstall these files?, or should I reload Ubuntu?. I've tried copying files from another laptop (same make ,Configuration as mine) but 2 files were not being copied.

share|improve this question

The files in /usr/lib/jni were all installed by various Ubuntu packages and they can be restored by reinstalling those packages. You can reinstall a package with a command like:

sudo apt-get install --reinstall <packagename>

where <packagename> is the name of the package you want to reinstall.

Figuring out which packages you need to reinstall might be a little tricky, because it looks like multiple packages install files in /usr/lib/jni. You can probably get a rough idea of the packages to reinstall with this command:

dpkg -l | grep jni

That will list the packages you have installed with jni in their names. I would start by reinstalling each of those packages and see if it fixes your problem.

share|improve this answer
actually i deleted the folder name JNI from the /usr/lib – karan Jun 15 '11 at 13:13
Reinstalling the package that is related to it will repair the folder structure, as it unpacks all the files from the initial .deb installer (which should contain the folder you deleted) – Thomas Ward Jun 15 '11 at 13:15
Yes, you need to reinstall the packages that originally installed the files in /usr/lib/jni that you deleted. I'll edit my answer to clarify. – Ben Williams Jun 15 '11 at 13:53

Find the JNI package name then run this command in terminal:

apt-get --reinstall install PACKAGE_NAME

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.