Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Ubuntu 18.04: I just rm -rf /usr/local/bin

  1. #1
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    270
    Distro
    Ubuntu 18.04 Bionic Beaver

    Question Ubuntu 18.04: I just rm -rf /usr/local/bin

    I meant to deleted a directory I had just moved in there, and I was distracted and pressed enter on the command and accidentally deleted /usr/local/bin.

    Is there anyway to recover this directory or regenerate it short of a fresh install?

    My system is incredibly customised, Manual Full System Encryption dual booting with VeraCrypt Windows 10 - it would take a long time to set it up from the beginning

  2. #2
    Join Date
    Jan 2006
    Location
    Sunny Southend-on-Sea
    Beans
    7,841
    Distro
    Kubuntu 18.04 Bionic Beaver

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    Nope.
    None but ourselves can free our minds

  3. #3
    Join Date
    Jun 2016
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    Quote Originally Posted by dusf View Post
    accidentally deleted /usr/local/bin.

    Is there anyway to recover this directory or regenerate it short of a fresh install?
    What did you have in there?
    Do you have a backup?

    A fresh install of the entire Ubuntu OS probably won't help you. /usr/local/bin is just an empty directory in a fresh buntu install.
    Last edited by halogen2; June 18th, 2020 at 11:22 PM.

  4. #4
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    270
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    Quote Originally Posted by CatKiller View Post
    Nope.


    Quote Originally Posted by halogen2 View Post
    What did you have in there?
    Do you have a backup?

    A fresh install of the entire Ubuntu OS probably won't help you, this is just an empty directory in a fresh buntu install.
    I am afraid the only backup I have is a directory somewhere else where I keep personal files, code, etc. and Insync syncs it to Google Drive.

    I do not recall ever putting anything in that directory, unless install scripts have or I have at some point. I am reading up about /usr/local/bin - is it similar to opt? If so I normally place programs I install manually in opt...

  5. #5
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,763
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    do a fresh install onto a USB thumb drive (a 2nd one if using one to install from). then copy its /usr/local/bin. that will at least get your recovery started. now you proceed to put your custom stuff back in there.
    Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweeter

  6. #6
    Join Date
    Jun 2016
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    As a start, do
    Code:
    sudo mkdir /usr/local/bin
    Then please post the output from running these commands in Terminal -
    Code:
    ls -la /usr/local/bin
    find /usr/local -type f

  7. #7
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    270
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    Quote Originally Posted by Skaperen View Post
    do a fresh install onto a USB thumb drive (a 2nd one if using one to install from). then copy its /usr/local/bin. that will at least get your recovery started. now you proceed to put your custom stuff back in there.
    Noted thanks.

  8. #8
    Join Date
    Oct 2010
    Location
    Dublin, Ireland
    Beans
    270
    Distro
    Ubuntu 18.04 Bionic Beaver

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    Quote Originally Posted by halogen2 View Post
    As a start, do
    Code:
    sudo mkdir /usr/local/bin
    Then please post the output from running these commands in Terminal -
    Code:
    ls -la /usr/local/bin
    find /usr/local -type f
    Code:
    runswithascript@contraption:~$ ls -la /usr/local/bintotal 8
    drwxr-xr-x  2 root root 4096 Jun 18 23:31 .
    drwxr-xr-x 10 root root 4096 Jun 18 23:31 ..
    runswithascript@contraption:~$ find /usr/local -type f
    /usr/local/sbin/refreshgrub
    /usr/local/share/applications/mimeinfo.cache
    /usr/local/share/applications/google-musicmanager.desktop
    refreshgrub is very important, it's something the custom encryption setup uses to fix grub chain loading whenever there is a big update. What can you discern from the output?
    Last edited by dusf; June 18th, 2020 at 11:35 PM.

  9. #9
    Join Date
    Jun 2016
    Beans
    2,023
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    Ok, now please do
    Code:
    echo "$PATH"
    Make sure /usr/local/bin is listed.

    How did you install refreshgrub? I would suggest you now reinstall refreshgrub, if you think there's any chance any part of it could have been in /usr/local/bin

    Can you please also post output of
    Code:
    cat /usr/local/share/applications/google-musicmanager.desktop

  10. #10
    Join Date
    Jan 2010
    Location
    Wheeling WV USA
    Beans
    1,763
    Distro
    Xubuntu 18.04 Bionic Beaver

    Re: Ubuntu 18.04: I just rm -rf /usr/local/bin

    i have a script that does all my install customization. i do a fresh install, reboot, and run my script. it installs more packages. a 2nd script adds my custom files which includes a setup script that runs each time i boot up. one of the things i did was quit putting custom files in /usr/local and started putting them in /usr/host instead. it is pure custom stuff, so that my custom build script can remove the whole thing and build it, again, totall from scratch, every time. thus if my changes delete a file, the rebuild omits it and there is no old leftover copy, anymore.
    Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweeter

Page 1 of 3 123 LastLast

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
  •