never run @rm -rf $(PREFIX)/bin/deluge

There are time when being ovidient bytes you in the ass.

For example the shell and rm, yes you know where I’m going. It turns out that the following command inside a makefile @rm -rf $(PREFIX)/bin/deluge does something really extrange. And yes it’s all my fault because I force it twice.

For some reason the r flag went to $(PREFIX)/bin and deleted everything, which I’m stil confused as to why.

ohh yes and $(PREFIX) was set to /usr, lovely isn’t it?

any ideas of how can I restore those files? I assume if I get the basic binaries for installing .deb it will show me the broken packages (read: all packages) then I could reinstall them all?

update:  So I got a liveCD and reinstalled my / keeping intact the home, this is one of the things I love about unix, even my windows positions where intact all I had to do was use the same username.

4 comments ↓

#1 xmonk on 06.29.07 at 7:09 am

Well, the -r is remove directory and their contents recursively, so I think you get the picture.

Because we are talking about /usr/bin and the dpkg and apt tools are installed in said directory, you are hosed, so your best move is, to do a re-install from CD, you don’t need or shouldn’t format the /usr partition (I am assuming /usr is it’s own partition), that way you wont loose what you have installed yourself in /usr/local.

If you don’t have a CD of Feisty, I’m assuming you are still using ubuntu, you are welcome, to come by my house and I’ll make you a copy or you can perform the install here, your choice.

#2 mae on 06.29.07 at 2:33 pm

@xmonk yes but should it remove recursive the deluge dir? why did it took /usr/bin? I found the answer and it’s even worst. it turns out I left a space after my macro therefore PREFIX=/usr” ” without the “” which got translated into rm -rf /usr /bin/deluge

About the reinstall I though of getting back the needed binaries for tar,gksu,apt-get,etc. but then I’ll probably end up with a lot of broken stuff, so I took the ocation to kill all the programs I really don’t use, and start fresh.

About the /usr/local part I do that differently, since I’m the only one using my laptop every program I install manually I put it inside $HOME/apps so I didn’t lose any of that.

#3 xmonk on 06.29.07 at 9:42 pm

Hmm.. a space was my first thought but as what you pasted there was no space, thought differently. Any how glad to know your data is safe, and you have a plan to proceed.

#4 mae on 07.02.07 at 6:44 pm

@xmonk well remember this is html in the end so the whitespace probably got deleted by wordpress.

actually I’m glad this happen my computer is cleaner right now :) I should go around leaving whitespace more often.

Leave a Comment