Results 1 to 9 of 9

Thread: How To recover '/bin '

  1. #1
    Join Date
    Oct 2013
    Beans
    7

    How To recover '/bin '

    hi, all
    i just did a stupid thing.
    i deleted the /bin directory with command ~$ sudo rm -r /bin
    i have a very old backup, but after that i intalled many many software...
    what can i do to recover it?
    or i can only reinstall the system?
    if i must reinstall the system, which configuration files should i keep?

    thx!

    [SOLVED]
    in #7

    thanks to Bashing-om
    long time ago, i used 'remastersys' backup my system, and i made a liveCD(actually it's a *.iso file).
    i wrote this iso file to my usb, and start my system with usb.
    i used command

    ~$ sudo cp -r -p /bin /media/185FEF56D231/regis
    ~$ sudo reboot

    and everything is OK!
    Last edited by Regis_Wang; December 11th, 2013 at 06:47 AM. Reason: Problem solved

  2. #2
    Join Date
    Jul 2013
    Beans
    129

    Re: How To recover '/bin '

    Pull it off your backup. You DO have a backup, don't you?

  3. #3
    Join Date
    Oct 2013
    Beans
    7

    Re: How To recover '/bin '

    yes, but it's a very old backup, does it work?

  4. #4
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    14,193
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: How To recover '/bin '

    Regis_Wang; Hi !

    A lot can change, version to version.
    Maybe; copy that directory from a liveDVD, exact version that you have installed. Not real sure that the links will be (re)established but, it is worth a shot.

    just what I think
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

  5. #5
    Join Date
    Oct 2013
    Beans
    7

    Re: How To recover '/bin '

    thx a lot!
    i'll try it!
    but after that how can i repair the links? you know, i installed many software.

  6. #6
    Join Date
    Jul 2010
    Location
    ozarks, Arkansas, USA
    Beans
    14,193
    Distro
    Xubuntu 22.04 Jammy Jellyfish

    Re: How To recover '/bin '

    Regis_Wang; Hey,

    I would not expect any installed software to be directly related to the "/bin" directory.
    Maybe there will be no broken links, will cross that bridge when we get to it.
    Worth a shot and see what results. I can think of nothing better to try, others here are also not offering a alternate solution.

    just try'n to help
    THE current(cy) in Documentation:
    https://help.ubuntu.com/community/PopularPages

    Happy ubuntu'n !

  7. #7
    Join Date
    Oct 2013
    Beans
    7

    Re: How To recover '/bin '

    how can i express my gratitude to you?
    i'm very appreciate!
    long time ago, i used 'remastersys' backup my system, and i made a liveCD(actually it's a *.iso file).
    i wrote this iso file to my usb, and start my system with usb.
    i used command

    ~$ sudo cp -r -p /bin /media/185FEF56D231/regis
    ~$ sudo reboot

    and everything is OK!

    thank you!

  8. #8
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: How To recover '/bin '

    Quote Originally Posted by Regis_Wang View Post
    yes, but it's a very old backup, does it work?

    Traditionally, /bin contains some essential command binaries that need to be available in single user mode for all users, like ls, cp, rm.... The syntax of this commands didn't change substantially in the past few years. So yes, it should work.

    Quote Originally Posted by Regis_Wang View Post
    thx a lot!
    i'll try it!
    but after that how can i repair the links? you know, i installed many software.
    You can list the packages which have files installed in /bin with:
    Code:
    dpkg -S /bin
    and you can reinstall them with:
    Code:
    sudo apt-get update
    sudo apt-get --reinstall install pkg1 pkg2 pkg3 ...
    where pkg1 pkg2 pkg3 ... are the name of the packages listed by dpkg.

    Even if you don't have a backup you only need a few GNU/utilities which you can copy over from a (binary compatible) Live CD/USB or existing Linux installation:


    • /bin/dash (I guess any POSIX-compliant shell will do it)
    • /bin/sh (must be a symlink to the shell /bin/dash)
    • /bin/sh.distrib (optional, same as sh, a symlink to dash)
    • /bin/cp
    • /bin/rm
    • /bin/sed
    • /bin/grep
    • /bin/tar
    • /bin/gzip


    Then you can chroot into Ubuntu and reinstall the packages you need.

  9. #9
    Join Date
    Oct 2013
    Beans
    7

    Re: How To recover '/bin '

    thank you!
    i learned a lot of things from you!
    next time i wouldn't worry about it.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •