[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: le reptil.png (249 KB, 815x778)
249 KB
249 KB PNG
just accidentally deleted my /usr/ folder
>>
how?
>>
>>100128306
did you really need it though?
>>
ok, restore to the previous snapshot then
>>
>>100128322
I extracted ncurses to mv downloads folder, which had had the name "usr" when unzipped. After I was done I tried to delete it but typed this instead:
sudo rm -r /usr/

>>100128326
Yes, now my pipewire sound is not working anymore.
>>100128334
But that was many months ago.
>>
>>100128367
dummy
>>
>>100128367
>But that was many months ago.
Just restore the /usr directory, silly
>>
>>100128400
What is the best and easiest way to do this?
>>
Well fuck it, It's time to move to Artix anyways.
>>
Just boot a livecd and run dd if=/dev/urandom of=/dev/sdX or /dev/nvme0 or w/e. Where of points to your base install disk. It can recover deleted data using AI
>>
>>100128473
That wont fix it, install either btrfs or zfs where you can do snapshots easily, recommending the second
>>
>>100128306
meh it's just program files. Back up /home and /etc, reinstall and you're good
>>
>>100128441
pkexec rm -rf /
>>
>>100128618
now you need --no-preserve-root
>>
>>100128635
but then it crashes? He must see the results of his actions and the feel impending doom of realization
>>
>>100128664
better disguise it as one of those base64 piped to aplay meme posts
>>
>>100128367
This is why you ALWAYS take a few seconds of your trime to CAREFULLY reread your command whenever you have to `sudo rm` something BEFORE you press return.
>>
before i type "-r" after "rm" i always prepend # to the whole command line so that a bad reflex doesn't accidentally run it or an incomplete form of it before i get a chance to review the whole thing. i'm sure you could also just add a wrapper function to your bashrc/zshrc/whatever that matches a '-'*'f' argument and asks questions before proceeding on an interactive shell, but commenting commands is more general.
>>
>>100128306
ok and?
just check if damaged with your package manager. if your package manager doesn't work anymore (since you probably RMd it) build/install it from source and run whatever command to rebuild your sysroot.
For Debian-likes, you have debootstrap, for fedora and EL likes, you have dnf --installroot=/ and the like.

tl;dr, you just need to reinstall your OS. You can use rpm --verify after you have a working /usr to try and recover/reinstall your broken installs from before.

also >>100128334
also don't listen to >>100128549
zfs is out-of-tree and thus a liability. btrfs is the only choice on linux that isn't shit.
>>
>>100128699
Well I always do that but I was drunk that night, I tried to cancel it before it deleted everything from the /usr/ folder but most of the damage was already done. On top of that I was already troubleshooting something else which was already frustrating.
>>
>>100128306
kek
touch grass
>>
File: ebussini.png (275 KB, 512x512)
275 KB
275 KB PNG
what was the usecase for the /usr/ folder again?
>>
>>100130388
unironically? good question.
>>
File: to16vlj.png (138 KB, 350x350)
138 KB
138 KB PNG
>>100130388
Don't you mean usrcase
>>
>>100128699
>>100128367
>troons dont just use their keyboards to select things and click a single button to delete it
>>
File: 1709247956201411.gif (890 KB, 245x180)
890 KB
890 KB GIF
>>100128306
Another retard filtered by the terminal. Just don't use it. Regular users were never meant to use the terminal. Use a GUI app like your file browser.
>>
>>100128306
fuck off dan
>>
>>100130492
heh
>>
>>100130492
Carlos im going to bash your head in
>>
>>100128367
This is why I don't use sudo unless I actually need it
>>100131000
>ctrl+shift delete
>enter
>oops, windows selection is shitty and buggy so I accidentally just deleted every folder and subfolder on my desktop
>>
>>100130388
If I tell you it's related to efforts to lower the age of consent will you shut the fuck up asking?
>>
just right click recycle bin and click restore, no worries
>>
Mostly harmless reinstall your os or use a backup the bitch is when you delete personal files that can’t be restored from a package manager
>>
>>100128306
Now you can't use the computer anymore
>>
>>100128367

Hiya there! I'll help you get back what you lost!

```
mkdir /usr/
```
>>
pacstrap base or something?
>>
File: 1713021406234814.png (147 KB, 444x444)
147 KB
147 KB PNG
>>100130492
>>
one time i ran an obfuscated rm -rf and there were so many files in my steam folder that it only deleted those before i canceled it. thank u gaben
>>
File: fartix-who-is-who.png (377 KB, 686x467)
377 KB
377 KB PNG
>>100128473
>Artix
>>
>>100133430
nice i thought this too - give me ur dgg username
>>
>>100128367
Why did you run the command with sudo if you were in your downloads folder, goofball?
>>
File: image.png (17 KB, 681x326)
17 KB
17 KB PNG
>>100130388
tl;dr, it's bloat
>>
File: silverblue.png (13 KB, 400x400)
13 KB
13 KB PNG
>>100128306
this is why you use immutable linux distros like silverblue.
>>
>boot into a live cd distro (arch linux)
>mount your root to /mnt
>copy live distro /usr/ to /mnt/usr
if your boot depends on certain packages, install the packages in the live distro, and then copy the /usr/

I have history of nuking /usr and /lib and got back my system that way. You might want to run the following if you face any problem
echo "run faster" | sudo tee /usr/lib/ld-linux-x86-64.so.2

Hope this helps
>>
unplug your PC from the wall for 30 seconds then plug it back in and boot as normal. you'll be g2g



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.