3

I have noticed that when I in Raspbian run the commands: sudo apt-get remove package and sudo apt-get purge package there are still files related to the package on my system such as folders with the package name in my /home/pi directory. I even ran sudo apt-get autoremove and sudo apt-get clean and the folders were still there.

I am concerned that overtime my system will have a lot of useless junk that apt-get did not keep catch when uninstalling the program. I even ran Bleachbit and it did not get rid of the folders.

Of course I can just delete them but I don't know if there are other config files related to the package so I would like to know a clean way of totally removing a package such that a system is exactly like it was before installing the package. Is that possible? Am I running apt-get the wrong way? Also, does anyone know if this is a problem with Arch Linux's Pacman manager too?

  • Are those files (e.g. in /home/pi) created during installation of the program or during running it? If it is the latter how could apt-get know? – Ghanima Feb 23 '16 at 15:32
  • Good point there, I have no idea when they were created. But my question still remains how I can totally remove software. – NULL Feb 23 '16 at 15:33
  • run an rpm query and see if the package is maybe still installed rpm -qa | grep packagename – Havnar Feb 23 '16 at 16:01
1

As @Ghanima pointed out, apt-get doesn't have the ability to know about every file that's installed on the system. Most files that are put under the user directory (/home/pi in this case), are done after the installation process.

An Example:

There's good reason for this. Let's say you install a package called foo, and your only user on the system is pi. apt-get installs foo, and then puts the appropriate configuration files in the /home/pi directory.

Later down the road, you add another user called "cake". Since cake wasn't present when the installation process occurred, that user doesn't have any configuration files within their profile. Your new user tries to run foo, and it promptly crashes and dies.

You could fix the crash by having foo write the config if it doesn't find it, but again, we're back to apt-get not recognizing that there is a file sitting under /home/cake. It wouldn't make sense for apt-get to remove some of the user configurations and not others. In fact, it may give an admin an illusion of success when they really shouldn't.

It happens in Windows too:

This isn't limited to apt-get. When you uninstall something in Windows, you rarely remove the files under %userprofile%\AppData. Some uninstallers will give you that choice, but again, it's not usually a default. I'm not even going to go into detail that is the nightmare known as the Windows Registry...

It probably happens in Arch too:

I have extremely limited experience with Arch, and by extension Pacman. I can't say with any authority that it has the same problems, but I would logically assume that it does. Unless they're putting in an unrealistically huge amount of work, there's no reason why it wouldn't.

It's not a big deal:

I am concerned that overtime my system will have a lot of useless junk that apt-get did not keep catch when uninstalling the program.

And what problem does the useless junk really entail? Configuration files are tiny, little things. Many are measured in bytes, and few are more than a couple KB. It might be annoying from a general principle kind of thing, but unless you're installing and uninstalling a huge amount of applications (that presents other issues) it's just not going to cause any kind of system issues.

  • Thank you for your helpful answer. One question though: are there other files besides in the home/user folder that are left around? For example when I uninstalled LibreOffice from Raspbian the "Start Menu" still had an entry to the program even though it didn't work when clicked. – NULL Feb 23 '16 at 19:11
  • @NULL: That sounds like an oversight by the package maintainer. Manually deleting the reference would suffice. Editing the LXDE menu should probably be addressed as a new question though. – Jacobm001 Feb 23 '16 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.