Is my Ubuntu in a broken state now?
Yes, your Ubuntu is broken
You messed up something important to package management.
So in practice, backup your important data (at least /etc
and /home
), perhaps also the list of installed packages e.g. output of dpkg -l
, and reinstall Ubuntu.
(a non-novice could try to manage - like in other answers -, but then he would not have done such a huge and basic mistake)
I could just admit to screwup reinstall the whole linux partition.
That is probably what would consume less of your time. Keeping your current system with the help of other answers is keeping it in a very messy state (which would give you future headaches).
Since you are reformatting your disk, consider putting /home
in a separate partition (so future such mistakes won't lose your data). Before doing that print on paper the output of df -h
and df -hi
and fdisk -l
(they give information about disk space -both used and available- ...). Be wise to have a large enough system partition (the root file system); if you can afford it 100 Gbytes is more than enough.
I was supposed to move the software bin -folder contents to /usr/bin
(terminology: Unix have directories, not "folders").
That (moving to /usr/bin/
) is very wrong. Either improve your $PATH (preferably) or at most add symlinks in /usr/bin/
and preferably move (or add symlinks) executables to /usr/local/bin/
.
The wise approach is to never change /usr/bin/
, /bin
, /sbin
, /usr/sbin/
outside of package management tools (e.g. dpkg
, apt-get
, aptitude
, etc...). Read the FHS.
Currently FileSystem Hierarchy Standard (FHS) is in version 2.3. To get an in-depth knowledge about it, Visit this page on Linux Foundation.
Also as answered by dr01, you can have a crisp knowledge about it at Wikipedia : FileSystem Hierarchy Standard.
Would like to add this beautiful image from this Source. I reference this image every now and then. But please note that none of the directories should be capitalized.
Feel free to add-in more details.
Best Answer
If your question is actually about restoring a system after a crash, you can safely forget about
tar
: it has a limit to the maximum length of the paths that is hardcoded in the format specs, and it doesn't handle hardlinks. For similar reasons, you shouldn't try to do backups withcp
,pax
,cpio
, orrsync
. A reasonable solution is to usedump
/restore
, or, better yet, use a dedicated package for backups. But that only addresses the problem of saving your files. It doesn't address issues related to size differences between old and new disks, or making your disks bootable.