2 ms·
Ah, this reminds me of the time a few years ago when I accidentally deleted `sudo`. A lot of stuff broke and it was interesting running around in a system where
by pedrovhb 4y ago
Ah, this reminds me of the time a few years ago when I accidentally deleted `sudo`. A lot of stuff broke and it was interesting running around in a system where things would sort of work, but sort of not really.
I learned then that sudo was really just a binary, so I tried to get a copy and put it in the right place. I couldn't, though, because I didn't have write permissions to it without sudo!
In hindsight I guess I could've just run the binary itself to get access, or put it elsewhere on my $PATH, or use `su` instead. Not sure if I tried those things, it was a while ago and I was pretty new to Linux. Maybe I got the file from the internet and didn't know to make it executable.
Anyway, what I ended up doing was booting up from a live Ubuntu USB and copying the sudo from the live environment to my installation on disk. It worked, and my newbie self felt like a proper hacker, fixing the unfixable. For one day I was a heart transplant surgeon :)
- alhirzel 4y agoNice solution and good instincts! I bet you’re a pretty advanced user by now. I used to keep an Arch Linux bootable thumb drive around as sort of an insurance policy against things like this. Good reminder for me…
- jcubic 4y agoThis reminds me my old Laptop with Linux installed that had Optical drive broken and no USB boot option, there was also no option to buy new Optical Drive. I was moving directories around to make some space on root directory. I've moved /var/ to /home directory and create symlink and it worked. But then later I wanted to do the same with /usr directory that had all shared libraries in /usr/lib/. In the process of moving files got some error I was not able to use any binary file like cd, ls or ln. Only applications that was running was working. I was certain that the laptop was dead and I will not able to use it anymore since I will not be able to install new system. So the task was to copy somehow all my important data. Luckily I was using Firefox and I've had FireFTP installed, so I've borrow my mother Windows laptop and installed FTP server and was able to copy my data over WiFi. Later it turns out that you could buy used DVD burner for that laptop, so it was resurrected and after installing Windows XP I've given that laptop to my mother.