LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-29-2014, 01:49 PM   #1
Chris.Bristol
Member
 
Registered: Jul 2011
Distribution: Ubuntu 20.04
Posts: 235

Rep: Reputation: 14
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.
 
Old 04-29-2014, 03:07 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by Chris.Bristol View Post
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.
 
1 members found this post helpful.
Old 04-30-2014, 12:45 PM   #3
Chris.Bristol
Member
 
Registered: Jul 2011
Distribution: Ubuntu 20.04
Posts: 235

Original Poster
Rep: Reputation: 14
Thanks for the feedback ondoho, to address your concerns:

There should be no risk of data loss.
Quote:
Originally Posted by ondoho View Post
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 View Post
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 View Post
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 View Post
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.
 
Old 04-30-2014, 01:38 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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.
 
Old 04-30-2014, 05:11 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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

Last edited by John VV; 04-30-2014 at 05:14 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] LXDE desktop and taskbar icon configuration problems Randicus Draco Albus Linux - Desktop 3 08-19-2011 09:56 PM
LXer: Icinga (Monitoring Solution) Installation And Configuration On CentOS LXer Syndicated Linux News 0 01-21-2011 12:10 PM
Sarge r1 installation: module configuration problems jakubi Debian 2 08-01-2006 02:24 AM
Apt configuration problems during Debian Installation gunncyclopedia Linux - Networking 4 04-10-2005 09:56 PM
Solution to glib installation problems? coldfusion713 Linux - Software 1 08-03-2003 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration