LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   A solution to some problems with desktop configuration after installation (https://www.linuxquestions.org/questions/linux-software-2/a-solution-to-some-problems-with-desktop-configuration-after-installation-4175503365/)

Chris.Bristol 04-29-2014 01:49 PM

A solution to some problems with desktop configuration after installation
 
I wouldn't suggest trying this until it has been reviewed by a few other users - and then only if you have done a backup and know exactly what you are doing. You might want to check the contents of the directories concerned for yourself. I have used mainly Debian-based distributions.

I have used Linux exclusively for several years, I changed from one distribution to another trying to find the one that suited me best, then settled on Ubuntu because it tended to work out of the box for me. Then Unity came along and I started trying other distributions again. I have the /home directory on a separate partition as that makes it safer and easier (usually) to install a new system. Despite formatting '/' during installation I have found a common problem that desktop settings like mouse buttons and wallpaper don't work afterwards and sometimes there are worse problems like missing window titlebars. This is caused by configuration files left in /home.

For example:
After moving from Ubuntu to Mint there were loads of problems, no-one seemed to know what to do about it.
After moving from Mint to elementary-OS most of the desktop settings were unchangeable.
I have not found any problems with switching to Ubuntu, perhaps the installation process carefully eliminates conflicting configuration files from /home/user before installation.

I have now created a bash script which I ran immediately after installation, it then needs a reboot for the OS to put back necessary missing files, some OSs might need re-installation, I have only tried it for elementary-OS. If anyone has any suggestions for directories to add to the list or any that should be removed please post them.
  • It aims to remove all the system setup files I could find.
    There should be no risk of data loss.
    It should not remove any application configuration files.
    It can be added to with experience of other distributions.
    It won't work if any of these directories are owned by a user they shouldn't be owned by - like root - you'd have to change their file permissions with sudo chmod 777 +R directoryname

Code:

# the ~  directory
rm -f -r ~/.compiz
rm -f -r ~/.gconf
rm -f -r ~/.gnome2
rm -f -r ~/.gnome2-private
rm -f -r ~/.gnome-commander

# the ~/.config directory
rm -f -r ~/.config/cinnamon-session
rm -f -r ~/.config/compiz-1
rm -f -r ~/.config/dconf
rm -f -r ~/.config/gnome-control-center
rm -f -r ~/.config/gnome-panel
rm -f -r ~/.config/gnome-session
rm -f -r ~/.config/gtk-2.0
rm -f -r ~/.config/gtk-3.0
rm -f -r ~/.config/nautilus
rm -f -r ~/.config/nautilus-actions
rm -f -r ~/.config/plank
rm -f -r ~/.config/ubuntu-tweak
rm -f -r ~/.config/ubuntu-ui-toolkit
rm -f -r ~/.config/unity-tweak-tool
 
# the ~/.cache  directory
rm -f -r ~/.cache/compizconfig-1
rm -f -r ~/.cache/docky
rm -f -r ~/.cache/dconf
rm -f -r ~/.cache/gnome-control-center
rm -f -r ~/.cache/mate
rm -f -r ~/.cache/plank
rm -f -r ~/.cache/unity
rm -f -r ~/.cache/unity-lens-photos
rm -f -r ~/.cache/unity-lens-video
rm -f -r ~/.cache/unity-tweak-tool

# the ~/.local/share  directory
rm -f -r ~/.local/share/cinnamon        #will remove Cinnamon applets etc
rm -f -r ~/.local/share/dockmanager
rm -f -r ~/.local/share/docky
rm -f -r ~/.local/share/nautilus
rm -f -r ~/.local/share/nemo
rm -f -r ~/.local/share/plank
rm -f -r ~/.local/share/unity-settings-daeman
rm -f -r ~/.local/share/unity/webapps


I have seen plenty of suggestions of ways of overcoming this problem. It is usually recommended to backup up, wipe /home, then restore - there is no way I would want to risk my data by having to rely on a backup, I would prefer to stick with a less than satisfactory distribution. In fact it wouldn't in itself solve the problem as the problem directories and files would still be in the backup. You would also have to identify which files you wanted to keep and only back those up. The solution suggested is more-or-less the opposite of that.

ondoho 04-29-2014 03:07 PM

Quote:

Originally Posted by Chris.Bristol (Post 5161402)
There should be no risk of data loss.

sorry, but:
- removing files IS data loss.
Quote:

It should not remove any application configuration files.
but by removing most of the .config folder you are doing exactly that. why do you think it's called config?
Quote:

you'd have to change their file permissions with sudo chmod 777 +R directoryname
you should never ever change file permissions to 777.
755, maybe, but if you got files in your $HOME that you don't have access to, then the problem is somewhere else and chmodding them just pastes over the problem.

generally i don't recommend moving $HOME to a new distro, esp. if it's a heavily graphical mainstream newbie distro like mint or ubuntu.
breakage is very likely to occur, or near endless manual adjusting, as you yourself stated.
it's much easier to have a seperate data partition with dedicated folders which can then be linked to $HOME/music, $HOME/images, and so on.

Chris.Bristol 04-30-2014 12:45 PM

Thanks for the feedback ondoho, to address your concerns:

There should be no risk of data loss.
Quote:

Originally Posted by ondoho (Post 5161467)
sorry, but:
- removing files IS data loss.

In theory every byte on the disk is "data" so deleting it is "data loss", but what I mean is "not losing any of the things I want like music, photos, emails and application configurations". I have no problem with deleting things I don't want.

Quote:

Originally Posted by ondoho (Post 5161467)
but by removing most of the .config folder you are doing exactly that. why do you think it's called config?

About 20% is not "most". I use "application" in the sense of "user program". I have only listed directories which are used for configuring the desktop.

Quote:

Originally Posted by ondoho (Post 5161467)
you should never ever change file permissions to 777.
755, maybe, but if you got files in your $HOME that you don't have access to, then the problem is somewhere else and chmodding them just pastes over the problem.

Ideally perhaps, but since they will immediately be deleted it is not very important. Perhaps it might be better and easier to run the Bash script with sudo instead.

Quote:

Originally Posted by ondoho (Post 5161467)
generally i don't recommend moving $HOME to a new distro, esp. if it's a heavily graphical mainstream newbie distro like mint or ubuntu.
breakage is very likely to occur, or near endless manual adjusting, as you yourself stated.
it's much easier to have a seperate data partition with dedicated folders which can then be linked to $HOME/music, $HOME/images, and so on.

Others people do, and I have found it to be a very good arrangement. I haven't had problems with 90% of the distributions I have used. If I were to use your arrangement I would be "removing most of the .config folder" after every installation, in fact I would be "removing" ALL of "the .config folder". I would also lose all my Thunderbird emails.





This may look like a sledgehammer to crack a walnut, but it worked for me and I have not found any other reasonable way of achieving it - I would have refined it so that the list only contained the necessary directories, but unfortunately I have found not found it possible to discover which directories are used for the desktop configuration even for just one distribution. Had I done so I would not have needed to use this method.

If anyone is an expert on desktop configuration files please enlighten me and I will correct the list of directories to delete.

ondoho 04-30-2014 01:38 PM

concerns? you requested reviews in post #1, i gave you one.

it's logically wrong to say "no risk of data loss" when you're actually deleting data, esp. with a recursive and force switch (rm -r -f). what if i saved my wedding pictures in ~/.gnome2-private?
it's logically wrong to say "not removing configuration files" when you're actually deleting configuration files.

but, let the readers decide if they want to use your "script" or not.

John VV 04-30-2014 05:11 PM

if you need to reset back to "factory" settings
just rename ~/.config to ~/.config-old
and do the same for other files

and log out and back in again

but making a NEW user would be best
if your user is " Bob" make a new user " Bob1"


some of your problems with the "rm" command is that the FILE IS STILL BEING USED
and can NOT be removed until a log out or reboot

as above using "chmod 777" is ALWAYS A VERY BAD IDEA !!!

and "rm -rf " is very very very VERY VERY VERY VERY dangerous

and should really never be in a script

but as to what you are doing
reusing the HOME FOLDER on the HOME partition for DIFFERENT distros
--- not a good idea , and is NEVER recommended

there are WAY too many conflicting config files for programs


All times are GMT -5. The time now is 09:23 PM.