You are not logged in.

#1 2011-09-11 15:38:22

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Question about uninstalling software and leftover files...

Why is it that if I install wicd, for example, it creates files in /etc and /var/lib that hang around even after I use pacman -Rscn to remove wicd?

Is this a bug or a design shortcoming or something intentional? I understand leaving dot-files in /home. That's completely different. These are system files, though.

Is it because these files are created after installation (I don't know if they are or not)?

The reason I care is because I'd love to try out Gnome3 and KDE on my laptop, but I will have a neurotic break if I end up with 1000 leftover files in my system once I decide I'm done with them.

Last edited by pogeymanz (2011-09-11 15:38:50)

Offline

#2 2011-09-11 16:11:02

benmorgan
Member
From: Germany
Registered: 2006-07-28
Posts: 67

Re: Question about uninstalling software and leftover files...

Pacman cannot manage files that are created after installation, or that do not belong to the installation. (The logic: what if an application installs a file to /etc/conf.d or /usr/bin. And then afterwards creates a file there. How is pacman supposed to know what belongs to it? It can't just delete everything in /etc/conf.d.)

It makes sense for wicd to put something in /var/lib. But Gnome or KDE should put most if not all of their stuff in the home directory... Don't quote me on that though, I don't use either.

Edit: forget this. It may be true if I myself put a file there, but I completely forgot about the install/uninstall script!

Last edited by benmorgan (2011-09-14 18:43:03)

Offline

#3 2011-09-11 16:26:03

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Question about uninstalling software and leftover files...

That's what I assumed was happening. It must have created these files after the installation. Though, I wonder if it's too much to have uninstall scripts for applications that are known to do this.

That way pacman can say "okay, let me check the uninstall script for wicd. It says wicd creates files in /var/lib/wicd/ and /etc/wicd/, so I'll delete those directories." Of course, this makes more work for the maintainer of these packages, but it doesn't seem like too much.

Offline

#4 2011-09-11 17:10:35

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Question about uninstalling software and leftover files...

Yes, in the install file. See PKGBUILD(5) for details.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#5 2011-09-11 17:11:30

benmorgan
Member
From: Germany
Registered: 2006-07-28
Posts: 67

Re: Question about uninstalling software and leftover files...

I stand corrected.

Offline

#6 2011-09-12 02:28:44

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: Question about uninstalling software and leftover files...

#!/bin/sh

pacman -Qlq | sort -u > db
find /bin /etc /lib /sbin /usr \
	-type d -printf '%p/\n' -o -type f -print | sort > fs
comm -23 fs db > trash
rm -f db fs

The code above check files on your system that are NOT in pacman DB.

sudo ./arch_trash.sh
less trash

The list of files in "trash" are *NOT trash* but really likely to be. grep them carefully.


"After you do enough distro research, you will choose Arch."

Offline

#7 2011-09-12 19:20:41

Leonid.I
Member
From: Aethyr
Registered: 2009-03-22
Posts: 999

Re: Question about uninstalling software and leftover files...

Shouldn't you use -print0 instead of -print?

EDIT: Which files does wicd create in /usr and /etc? There is nothing in its install script, AFAICT...

trunk$ svn info
Path: .
URL: svn://svn.archlinux.org/packages/wicd/trunk
Repository Root: svn://svn.archlinux.org/packages
Repository UUID: eb2447ed-0c53-47e4-bac8-5bc4a241df78
Revision: 137933
Node Kind: directory
Schedule: normal
Last Changed Author: ronald
Last Changed Rev: 135932
Last Changed Date: 2011-08-20 06:35:33 -0500 (Sat, 20 Aug 2011)

Last edited by Leonid.I (2011-09-12 19:31:53)


Arch Linux is more than just GNU/Linux -- it's an adventure
pkill -9 systemd

Offline

#8 2011-09-13 23:38:27

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: Question about uninstalling software and leftover files...

The wicd package installs numerous files/dirs under both /etc and /var/lib, and those are all removed during the uninstall with -Rsn switches, but however, as allready mentioned, post-install created files, cannot be tracked by the pacman db and hence, isn't removed.

These should however nearly always go into home folder, as e.g. most apps is run without root privs. so cannot even write elsewhere...

Then, there's also the situation where dirs are leftover, because if you e.g. add an extra profile file to a generated folder under e.g. /etc or whatever, then the uninstall of the app will remove all the files in the pacman db of that app and it's directory, but because an extra file was added manually, then that file is left alone, which then also means that the directory cannot be deleted either...

Offline

#9 2011-09-14 13:27:29

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

Re: Question about uninstalling software and leftover files...

mhertz wrote:

The wicd package installs numerous files/dirs under both /etc and /var/lib, and those are all removed during the uninstall with -Rsn switches, but however, as allready mentioned, post-install created files, cannot be tracked by the pacman db and hence, isn't removed.

These should however nearly always go into home folder, as e.g. most apps is run without root privs. so cannot even write elsewhere...

Then, there's also the situation where dirs are leftover, because if you e.g. add an extra profile file to a generated folder under e.g. /etc or whatever, then the uninstall of the app will remove all the files in the pacman db of that app and it's directory, but because an extra file was added manually, then that file is left alone, which then also means that the directory cannot be deleted either...


I see. I wonder if some day pacman might give a message about such an occurrence.

Offline

Board footer

Powered by FluxBB