You are not logged in.

#1 2012-05-16 23:23:01

yasar11732
Member
Registered: 2010-11-29
Posts: 127

Find files not tracked by pacman [SOLVED]

I sometimes install files without using pacman. For example, I did use python installer, or just copy pasted some files into /bin etc. I know I can use find and get list of all files, and make a pacman -Qo for each, but it takes a lot of time to query each file seperately . Is there a better way that I can use to get a list of files that are not tracked by pacman?

Last edited by yasar11732 (2012-05-17 03:50:32)


Yo Dawg, I heard you likes patches, so I have created a patch for your patch, so you can patch your patches before you patch.

Offline

#2 2012-05-16 23:44:46

Allan
Member
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,027
Website

Online

#3 2012-05-16 23:52:20

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,269
Website

Re: Find files not tracked by pacman [SOLVED]

#!/bin/sh

tmp=${TMPDIR-/tmp}/pacman-disowned-$UID-$$
db=$tmp/db
fs=$tmp/fs

mkdir "$tmp"
trap  'rm -rf "$tmp"' EXIT

pacman -Qlq | sort -u > "$db"

find /bin /etc /lib /sbin /usr \
	! -name lost+found \
	\( -type d -printf '%p/\n' -o -print \) | sort > "$fs"

comm -23 "$fs" "$db"|less

...I forget where I got that code.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2012-05-17 03:50:18

yasar11732
Member
Registered: 2010-11-29
Posts: 127

Re: Find files not tracked by pacman [SOLVED]

Thanks a lot.


Yo Dawg, I heard you likes patches, so I have created a patch for your patch, so you can patch your patches before you patch.

Offline

#5 2012-05-18 11:31:17

rwd
Member
Registered: 2009-02-08
Posts: 658

Re: Find files not tracked by pacman [SOLVED]

yasar11732, please read the wiki before posting:

https://wiki.archlinux.org/index.php/Pa … ny_package

Last edited by rwd (2012-05-18 11:31:50)

Offline

#6 2013-11-06 12:06:36

techlive
Member
Registered: 2009-05-02
Posts: 25

Re: Find files not tracked by pacman [SOLVED]

HERE are two one linear scripts that will do the job.

Show dirs that don't belong to any package:

alias pacman-disowned-dirs="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type d -print | sed 's/\([^/]\)$/\1\//' | sort -u) <(pacman -Qlq | sort -u)"

Show files that don't belong to any package:

alias pacman-disowned-files="comm -23 <(sudo find / \( -path '/dev' -o -path '/sys' -o -path '/run' -o -path '/tmp' -o -path '/mnt' -o -path '/srv' -o -path '/proc' -o -path '/boot' -o -path '/home' -o -path '/root' -o -path '/media' -o -path '/var/lib/pacman' -o -path '/var/cache/pacman' \) -prune -o -type f -print | sort -u) <(pacman -Qlq | sort -u)"

Offline

#7 2013-11-06 14:45:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Find files not tracked by pacman [SOLVED]

techlive, IMHO adding them to the wiki is enough, you don't have to bump old threads.

Offline

#8 2013-11-06 15:27:38

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,269
Website

Re: Find files not tracked by pacman [SOLVED]

See lostfiles in the AUR.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB