Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Accidentally Deleted /usr/bin - Ubuntu 12.10

  1. #1
    Join Date
    May 2012
    Beans
    40

    Accidentally Deleted /usr/bin - Ubuntu 12.10

    Hey, I made a huge mistake when I ran the command:
    Code:
    rm -r *
    in /usr/bin
    I've found a decent post (http://askubuntu.com/questions/19194...yping-in-rm-rf) with a recovery strategy, but it requires dpkg to be installed. I downloaded the .deb file for dpkg, but this seems to be a recursive problem...I need dpkg to run .deb files.

    Does anyone have a solution to my problem?

    Thanks!

  2. #2
    Join Date
    May 2007
    Location
    San Francisco, California
    Beans
    5,857
    Distro
    Ubuntu Development Release

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    Grab a LiveCD, chroot into your install and reinstall all your (well most of your important packages) again. I think it would be faster to be honest.

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

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    AustenG; Hi !

    +1 to change root.
    Copy any important files, and re-install.
    Trying to rebuild a system directory would be a nightmare and time intensive. Even if I were to copy the entire directory from a working system ---many concerns would remain(sym links and hard links for one).

    As an exercise for learning ...great opportunity!

    I can think of no course of action that I am sure would result in a trustworthy /bin/ directory.

    In this instance I do endorse a re-install

    just in my opinion <==BDQ

  4. #4
    Join Date
    Mar 2009
    Beans
    Hidden!

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    Quote Originally Posted by AustenG View Post
    Does anyone have a solution to my problem?
    Stop using the terminal. :P

  5. #5
    Join Date
    May 2012
    Beans
    40

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    Thanks for the response guys! Alright, I'll give reinstallation from a live cd a go. Love all of the new stuff I'm learning, but sometimes it gets frustrating having to set up everything over and over again.

    Does anybody know if all of my stuff on my Ubuntu partition will be there? If I reinstall will I lose anything?

  6. #6
    Join Date
    May 2012
    Beans
    40

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    No way I'll ever stop using the terminal - I'm both a scientist and a curious guy! That's no solution at all. Plus, I'm sure even the best of the best have done silly things like this before.

  7. #7
    Join Date
    Mar 2009
    Beans
    Hidden!

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    Quote Originally Posted by AustenG View Post
    Does anybody know if all of my stuff on my Ubuntu partition will be there? If I reinstall will I lose anything?
    Personally, liking fresh installs, if I were you I would backup the stuff, and proceed with disk formatting. Here are some guidelines, which will perhaps orient some of your actions:

    Extraneous file systems are not automatically mounted. An intuitive, graphical-interface method of mounting one is simply to press the folder icon in the launcher at the left, then left-click once on the device (e.g., 128 GB Volume).

    Then, you can see it has been mounted by navigating to / (click on "file system" on the left bar of the file browser, which in fact is the LiveCD file system), then to /media. An "ubuntu" folder should now be present, which contains the mounted volume. This (/media/ubuntu) is the folder you might want to chown, chmod, or, for good measure, both.

    Code:
    chmod -R 777 /media/volume
    Then, backup to desired device, and reinstall 12.10 afresh. Alternatively, do it like you are seeing or feeling it, by all means.

    Quote Originally Posted by AustenG View Post
    No way I'll ever stop using the terminal - I'm both a scientist and
    Quote Originally Posted by AustenG View Post
    No way I'll ever stop using the terminal - I'm both a scientist and a curious guy! That's no solution at all. Plus, I'm sure even the best of the best have done silly things like this before.
    a curious guy! That's no solution at all. Plus, I'm sure even the best of the best have done silly things like this before.
    Nothing beats the time I have locked myself out of the administrator account through the GUI.

    EDIT: yeah you're right though... nice attitude of yours.
    Last edited by twipley; October 30th, 2012 at 02:18 AM.

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

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    As to re-installing and not loosing anything ...not advising this course of action...but, I have re-installed on occasion and If I re-installed using the same username and password, and did NOT re-partition ; All my data and configs remained intact. [ I have been pleasantly surprised !]

    I too am guilty of playing with it till it breaks, Try and try to fix it ...run out of time (need my system for a purpose)..or just my frustration level gets exceeded -->>re-install ! Yes I am guilty ( I learned to keep good backups, isolated from my operating system, nice safe and secure !) ...now, I have progressed to the point that with a live cd and my backup I can fix what ever I may have broke. And believe me, the more I learn about this system, the more I realize how little I actually do know. And I keep learning !

    I say again..there is no substitute for a good backup !
    imho ==> BDQ

  9. #9
    Join Date
    May 2012
    Beans
    40

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    Okay, I've booted from a live cd. I'm currently backing everything up, but the next step I want to try before I have to re-install is to copy and paste the /usr/bin from the live cd to my partition. I know I won't get everything back that I had before, but I'll at least get apt, sudo, dpkg, and other important things that the os will definitely need.

    Does anyone know how to do this? When I boot from a live cd, I can access the /usr/bin directory from a terminal. But, how do I copy and paste this to my /usr/bin on my Ubuntu partition? I'm guessing I have to mount the drive as rw.

  10. #10
    Join Date
    May 2012
    Beans
    40

    Re: Accidentally Deleted /usr/bin - Ubuntu 12.10

    @CraftyKisses - Your original suggestion about chroot into my install: could you maybe give some specific instructions? This is my first time doing something like this.

    If it helps, my
    Code:
    sudo fdisk -l
    returns:

    Code:
    ubuntu@ubuntu:/$ sudo fdisk -l
    
    Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x99b3a87f
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      206847      102400    7  HPFS/NTFS/exFAT
    /dev/sda2          206848  1048782847   524288000    7  HPFS/NTFS/exFAT
    /dev/sda3      1048782848  1953523711   452370432    5  Extended
    /dev/sda5      1048784896  1350365183   150790144   83  Linux
    /dev/sda6      1350367232  1352464383     1048576   82  Linux swap / Solaris
    /dev/sda7      1352466432  1953523711   300528640   83  Linux
    
    Disk /dev/sdb: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0004571a
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *          63   488392064   244196001    c  W95 FAT32 (LBA)

Page 1 of 2 12 LastLast

Tags for this Thread

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
  •