2

Accidentally I removed lib and tmp folders.

sudo rm -rf /lib
sudo rm -rf /tmp

Is there any way how I can restore /lib folder?

I thought that I can create '/lib' folder manually, find at internet ubuntu lib folder and upload it there, but:

$ mkdir
$ bash: /bin/mkdir: No such file or directory

2 Answers2

0

Okay, We can boot live ubuntu and copy that live boot lib folder to your os folder

liveOS: /usr /lib to YourOS: /usr /lib

now may be your OS will boot perfectly but your application can't so that run this script as per instruction

  1. sudo apt-get clean
  2. paste below into reinstall_all.sh

    #!/bin/bash
    for pkg in dpkg --get-selections | awk '{print $1}' | egrep -v '(dpkg|apt|mysql|mythtv)' ; do apt-get -y --force-yes install --reinstall $pkg ; done

  3. sudo chown root:root reinstall_all.sh

  4. sudo chmod 755 reinstall_all.sh

  5. sudo ./reinstall_all.sh

this method will take too much time and internet depend on packages which you instlled in past. sorry for bin

abba5
  • 1
0

Without a backup you have virtually no chance. The effort is not worth it. Re-install your system and avoid these actions in the future. Linux is robust, but Linux forgives mistakes very rarely.

  • /lib – Essential libraries for the binaries in /bin and /sbin
  • /bin – Essential command binaries that need to be available in single user mode
  • /sbin – Essential system binaries

Read this:

Re-install Ubuntu without losing data in home folder

What's a good back-up strategy for 1 desktop PC?

Sorry to be the harbinger of bad news.

A.B.
  • 90,397