Cobra Forum

Linux => New to Ubuntu => Topic started by: mahesh on Aug 26, 2023, 08:14 AM

Title: I accidentally deleted the lib folder
Post by: mahesh on Aug 26, 2023, 08:14 AM
I'm sorry if I'm not well understood, I don't speak English and I'm using a translator to write the message. I add that I am new to Ubuntu.
I had a problem when running an application, it told me that it could not find a file in a path. So I followed the path and created a /lib folder in that path to try to fix the problem. I tried to run the app again and the problem was not resolved. So I tried to revert the changes I made which was to create that /lib folder and a file inside the folder. To remove the folder I used sudo rm -r /lib. Or at least I think that was the command I used. After a few seconds my terminal closed and I couldn't launch it again. A few minutes passed, my pc went to sleep and when I tried to access again it did not recognize the space where I entered my user password. Therefore I turned it off, now that I turn it on it shows me the following, in addition to other error lines:
run-init: can't execute '/sbin/init' No such file or directory


I think I made a mistake in the path and did not delete the /lib folder from the directory I was in, instead I deleted some lib folder from the root of my system. I would like to know if I can revert the changes to recover the system.


UPDATE: I tried to repair my OS, I booted Ubuntu in test mode from a USB. I went to the root and compared the folders that exist on my damaged pc vs. the folders that exist on my startup in test mode. Sure enough, there is no lib folder.
How could I get her back? I tried to copy with "sudo cp -r /lib /dev/[name that is assigned to the partition with my damaged OS]". The command runs but the /lib folder is not pasted.