You are not logged in.

#1 2011-12-26 23:47:53

peoro
Member
Registered: 2007-06-10
Posts: 67

Stray files in my system

Hello,

In order to see how clean my system was, I was looking into system directories to check whether there were manually installed files.

Found out that there are a few files not owned by any package:

# for i in `find /etc/ -type f`; do pacman -Qo $i &> /dev/null || echo $i; done
/etc/modprobe.d/sound_persistent.conf
/etc/ssl/certs/ca-certificates.crt
/etc/ssl/certs/java/cacerts
/etc/udev/rules.d/network_persistent.rules
/etc/.pwd.lock
/etc/localtime
/etc/gshadow-
/etc/group-
/etc/passwd-
/etc/ld.so.cache
/etc/shadow-
/etc/wicd/manager-settings.conf
/etc/wicd/wireless-settings.conf
/etc/wicd/wired-settings.conf
/etc/wicd/dhclient.conf.template
/etc/pango/pango.modules
/etc/gtk-2.0/gtk.immodules
/etc/xml/catalog
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
/etc/ssh/ssh_host_key
/etc/ssh/ssh_host_key.pub
/etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key.pub
/etc/ssh/ssh_host_dsa_key
/etc/ssh/ssh_host_dsa_key.pub
/etc/ssh/ssh_host_ecdsa_key
/etc/ssh/ssh_host_ecdsa_key.pub
/etc/mtab.fuselock

# for i in `find /usr/ -type f`; do pacman -Qo $i &> /dev/null || echo $i; done
/usr/share/info/dir
#still running ...

Is it a wanted thing to have these stray files or is it a bug?

Offline

#2 2011-12-26 23:58:28

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: Stray files in my system

I can't say for all of those files, but for many they are necessary and *in a sense* they do belong to your installed packages.  They just are not listed by pacman as they were not installed with the package, they were created later.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2011-12-27 00:10:54

Lars Stokholm
Member
From: Denmark
Registered: 2009-03-17
Posts: 223

Re: Stray files in my system

To the best of my knowledge most (if not all) of those files are deleted when you remove the relevant package with pacman. Look at the post_remove function here for example: packages/shared-mime-info. As Trilby says the files are created after the package has been installed, so pacman has no way of knowing they're there.

A couple of the files you list are created by yourself I think (those in modprobe.d and conf.d). The files named *- are backup files I believe, created when the original files are modified. Besides that there are some cache files in your list.

That being said I still like keeping track of them, like you do, so I use this script:

#!/bin/bash
#
# orphanfinder: Find files not in Pacman's database
#

INCLUDE="/bin /etc /lib /lib64 /opt /sbin /usr"
EXCLUDE="\/(certs|fonts|grub|mime)\/"

echo "LAST ACCESS           ORPHANED FILE"

comm -23 \
  <(find ${INCLUDE} 2>/dev/null | sort) \
  <(pacman -Qlq | sed "s/^\(.*\)\/$/\1/" | sort -u) | \
  egrep -v ${EXCLUDE} | \
  while read file; do
    stat -c %x "${file}" | cut -d. -f1 | tr -d "\n"
    echo "   ${file}"
  done | sort

exit 0

It's a version of the script found at the pacman wiki page, which I modified for my own personal taste. It's a lot faster than your method.

Edit: Forgot the link.

Last edited by Lars Stokholm (2011-12-27 08:57:10)

Offline

#4 2011-12-30 23:03:16

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: Stray files in my system

Taking a look at the list you posted:

Configuration Files (created on first run)
/etc/modprobe.d/sound_persistent.conf
/etc/wicd/manager-settings.conf
/etc/wicd/wireless-settings.conf
/etc/wicd/wired-settings.conf
/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
/etc/udev/rules.d/network_persistent.rules

Backup Files (created by the editor you used):
/etc/gshadow-
/etc/group-
/etc/passwd-
/etc/shadow-

Lock Files (created while using the application):
/etc/mtab.fuselock
/etc/.pwd.lock

Created at some point after the installation of openssh:
/etc/ssh/ssh_host_key
/etc/ssh/ssh_host_key.pub
/etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key.pub
/etc/ssh/ssh_host_dsa_key
/etc/ssh/ssh_host_dsa_key.pub
/etc/ssh/ssh_host_ecdsa_key
/etc/ssh/ssh_host_ecdsa_key.pub

Quite a few of those files aren't part of the package for the simple reason that those files didn't come with the package. They may have been created while using it after installation, but we can't really wipe that can we. How would we decide what post-install even belongs to an application, let along how to decide which one to delete.

TL;DR: yeah that's expected

Last edited by stefanwilkens (2011-12-30 23:08:14)


Arch i686 on Phenom X4 | GTX760

Offline

#5 2012-01-20 15:29:06

OrangeRoot1000
Member
From: TN -- USA
Registered: 2008-08-07
Posts: 106
Website

Re: Stray files in my system

Those files are NOT strays deleting them will cause you mostly network problems. They are global settings for WICD which controls your network connection, SSH, all your groups and passwds are double backed up in case of major catastrophe. The top line things that live in modprobe.d are instructions for modules that were detected on your install so they hold across reboots.

Offline

Board footer

Powered by FluxBB