# How not to mess up a system, yet keep it clean?

I am newbie to Ubuntu, I got into it 2 weeks ago and I reinstalled it like 10+ times already.
In most cases Ubuntu graphic interface wont show up, just command line.
Few times I had "low graphic settings" error.
All of this happens mostly when I decide to remove useless repository, or install-remove some programs, or remove some pre-installed programs like Rhytmbox or Solitaire, which definitely shouldn't give any problems, but than baah - and my Ubunt wont load.

I think that good way to keep system alive is never to uninstall anything. But sometimes when I install some program from some repository, and I dont need it - I want to remove repository aswell and again my Ubuntu gets destroyed.

How can I keep my system clean yet working?
What should I do?
Should I maybe use some backup-program also? How can I organize my files/system so that I dont have to reinstall it all every time I mess something?

Thanks alot!

P.S.: For example right now I installed LAMP using taskel. Something went wrong, mySQL didn't get installed, so I want to remove it all and retry. how do I do it properly?
Or, say, JDE. I installed Oracle 7 JDE since I needed it for PhpStorm, I failed to install it since some repository didnt exist. Next time failed version installed. After finally removing old stuff and installing Oracle 7 it worked, than I rebooted and bah - again my system wont load. What am I doing wrong? Am I lost for this world? :)

-

Basically, your going about this all wrong. In you example, a failed lamp install could have just been fixed with sudo apt-get -f install Same thing with JDE. sudo apt-get remove name-of-package-here works for everything you installed via apt. If you installed via dpkg then sudo dpkg --remove package-name-here.

Missing or incorrect configuration can cause X (the GUI system) to not start. Usually you fix this is just a matter of removing /etc/X11/xorg.conf and then sudo restart lightdm. If that doesn't work you may need to re-configure your drivers. How you do that depends on your hardware and setup.

Removing repositories is dangerous. It's fine to do it. But when you install something via apt you install all it's dependencies. By removing a repository you could be removing more then the repository for just one package. apt will leave the old debs installed (from the disabled repo) but they will be "orphaned", meaning they will never get updates again (unless there in another repo). This is even more problematic if your using a "nightly" repo that supplies dependencies that are shared by many repos. apt will always use the "latest" version, but that version is in a repo that no longer exists.

Re-installing is silly. You should NEVER have to re-install Ubuntu, short of a hard drive failure, or partitioning mix up.

For backups: I recommend back-in-time. It's very easy to use. You should backup your \$HOME directory and probably /etc/. Don't even bother backing up the rest. The only exception would be if you put files in an odd location.

One other side note. Won't load, is not that helpful. I am assuming, by your questions that X is not loading. The console is fully functional and can be used to fix problems with X not loading in very short order.

Stick with it. Once the learning curve is over, Linux is very easy to use and maintain.

-
Thanks for your reply! I know that reinstalling is sily, but how else can I deal with my problems if my system doesn't load? It shows black screen with blinking console entry point but I cant enter anything in it. There were moments when I could use terminal or console, that's right, but sometimes it was locked. Why is that? And yeah, Windows...never again xD used to be C# developer, but on PHP side now and getting to love Ubuntu, so yeah =) thanks! –  Chelios Nov 17 '12 at 13:47
if you just get a single blinking cursor, it's most likely a failed X start. Press Ctrl+Alt+F1 and see you you get a text console. If you do, move on from there if you do not, then reboot, and in in grub choose "advanced options" and choose a "rescue mode" option. –  coteyr Nov 17 '12 at 13:53
Keep in mind that even if that doesn't work you can always boot to a liveCD (the install disk) and just edit your config files from there. –  coteyr Nov 17 '12 at 13:54

Welcome to the Open Source side :)

First thing you should do is ensure that you mount your /home directory on a separate partition. This way, when you re-install, you can give the same username as last time and you get everything properly i.e. your data is completely fine. You do get the old settings because these are saved in /home/username/.xyz with xyz being whatever program saved the settings. However, you can simply delete the folder you don't like from there. (Just make sure you don't delete something you're not sure about.)

Secondly, look up aptitude. If you install programs using aptitude, you can remove it and it does a good job of cleaning stuff up.

-
Thanks! So I basically separate system from everything else, and I can reinstall system while keeping all the programs and my own documents/multimedia/programs files? –  Chelios Nov 17 '12 at 13:50
Exactly. In case you (or a future reader) are unaware, you can create a separate /home partition when you install. –  recluze Nov 18 '12 at 3:52