Tuesday, April 30, 2024
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 663  / 3 Years ago, fri, june 18, 2021, 4:32:10

An android project has its /bin directory and what I wanted to do is to deleted this. What I actually mean is delete /path/to/android-project/bin not the /bin directory.



So I executed this command,



path/to/android-project$ sudo rm -rf /bin



Now, the entire /bin directory is deleted. I wanted to try restoring it in by using terminal but I cant launch the terminal since there are files in /bin related to terminal that have been deleted (my guess).



Are there any ways to restore /bin directory? I'm looking into upgrading ubuntu.


More From » command-line

 Answers
2

/bin contains some of the most basic files on your system, and it won't be able to do much without it (booting will not work, same for installing packages). Your best bet is to boot a live cd of the same Ubuntu version as what you are using, mount your exisitng root partition and rsync its /bin over to that partition.



For a full cleanup afterwards, reinstall the affected packages. To find which packages to reinstall, use this command:



find /bin -type f | xargs dpkg -S | sed -e 's/:.*//' | sort -u


And to actually reinstall them:



sudo apt-get install --reinstall $(find /bin -type f | xargs dpkg -S | sed -e 's/:.*//' | sort -u)

[#32027] Sunday, June 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ousear

Total Points: 395
Total Questions: 114
Total Answers: 89

Location: Jordan
Member since Thu, Aug 5, 2021
3 Years ago
;