I can't think of a quick fix short of going through deleting what you know isn't installed and manually Googling what you can't identify. It's a horrible problem that I've just opted for the Etch-a-Sketch method and either deleted my whole profile or have deleted large chunks of it (.config
, .gnome-2
, etc)
The only long term solution I could think of doing this is setting up an online database of:
- Packages
- What configuration paths they use
You'd store that information in a simple JSON "database", perhaps gzip it and store it somewhere online.
You'd then have a tool that downloaded this global list and scanned the paths, looking for corresponding paths in the user's home. Where there are matches, you check the package list to see if that package is still installed. If it's not, it goes on a death-list.
After that scan, the user gets a list of available clean-up operations (with detail on what package the program thinks it is) and it given the option to nuke whatever they like.
In a perfect world, we'd have this integrated right into the packaging system (and have apt-get clean-my-home
), but I think that's a pipe dream. Maintainers would have to do a ton of work on top of requiring reengineering the package database formats (which are shakey enough already).
As getting this written into the fabric of each package is unappealing, there also needs to be some sort of interface for normal people to suggest paths for packages. (As it's my dayjob) I'd probably suggest a quick and dirty web-app where people can make their suggestions and MOTUs, Ubuntu members, etc can moderate the flow to make sure people aren't suggesting potentially dangerous searches.
As it is, it's going to require a whole load of manpower to get the however-many thousand apps that write home-files.
This is an interesting problem. This might give me a good excuse to play with Quickly's cli template (Quickly because I'm a Pythonista and also because packaging scares me).
I've done this quite often now - almost every time I did upgrade my system or (especially) if I switched to another distro.
I normally log out, go to a console and log in as root directly (or depending on system configuration, as another user and switch to root), cd to /home folder and simply change my user's home folder name e.g. to "myUserName.bak".
e.g.:
sudo mv /home/myUserName /home/myUserName.bak
After installation I can safely move all data needed to the newly created home folder for my user. (That's also a good point for thinking whether you e.g. really need that folder of big files you never touched the last 2 years ;) )
edit as suggested by comments:
before you can access the files and folders from your renamed home folder you have to
sudo chown -R newUser.newUsersGroup /home/myUserName.bak
Best Answer
There are two issues:
See : https://www.debian.org/doc/debian-policy/ for details
HOWEVER .....
So it is possible for .deb to violate debian policy and alter files in user home directories.
This is one of many considerations or reasons you should be very careful when installing .deb from outside the Ubuntu repositories.