How to find files that are not owned by any package?
In my system I have files that not belong to any package, they are mine or from compiled programs installed with make install
. How can I find all files that do not belong to any package?
debian apt repository
add a comment |
In my system I have files that not belong to any package, they are mine or from compiled programs installed with make install
. How can I find all files that do not belong to any package?
debian apt repository
add a comment |
In my system I have files that not belong to any package, they are mine or from compiled programs installed with make install
. How can I find all files that do not belong to any package?
debian apt repository
In my system I have files that not belong to any package, they are mine or from compiled programs installed with make install
. How can I find all files that do not belong to any package?
debian apt repository
debian apt repository
edited Sep 2 '14 at 5:02
HalosGhost
3,70592235
3,70592235
asked Sep 2 '14 at 4:41
geaplanet
534
534
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
In /var/lib/dpkg/info
are .list
text files that list all the files contained in each package¹ installed through Debian's package manager.
Finding all files in the filesystem not matching any entry there can be achieved with something naïve like this:
find / -xdev -type f ( -exec grep -xq "{}" /var/lib/dpkg/info/*.list ; -or -print )
This will obviously take a very long time as the whole filesystem will be scanned. If you use different partitions for system directories (such as /usr
or /var
), specify them after the initial /
.
Warning: That does not include files created by package scripts. For instance:
/etc/hosts.allow
is not listed anywhere but it might come fromlibwrap0
that possibly created it, if that file didn't exist at time of the package installation.- Many files are compiled during installation, for example
.pyc
files (compiled Python libraries),.elc
files (compiled Emacs Lisp librarires), etc. - …
errorfind: argument list too long
– naught101
Aug 16 at 4:14
@naught101 That suggests there are a gazillion files matching/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.
– Patrice Levesque
Aug 20 at 19:32
add a comment |
A more efficient version of @Patrice's solution, using a shell with support for process substitution (bash
, AT&T ksh
, zsh
):
(
export LC_ALL=C
comm -23 <(find / -xdev -type f | sort)
<(sort -u /var/lib/dpkg/info/*.list)
)
Like Patrice's solution, it assumes no file path contains newline characters.
1
Would using thelocate
database be faster than runningfind
?locate * | grep -v "^/home/"
- also has the benefit of looking in/boot/
and other system partitions.
– naught101
Jun 6 at 3:45
add a comment |
Since you tagged you question with debian
the obvious choice not mentioned yet is to use cruft-ng
if you don't require any flexibility or cruft
if you don't want to search through the whole system/locatedb.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f153260%2fhow-to-find-files-that-are-not-owned-by-any-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In /var/lib/dpkg/info
are .list
text files that list all the files contained in each package¹ installed through Debian's package manager.
Finding all files in the filesystem not matching any entry there can be achieved with something naïve like this:
find / -xdev -type f ( -exec grep -xq "{}" /var/lib/dpkg/info/*.list ; -or -print )
This will obviously take a very long time as the whole filesystem will be scanned. If you use different partitions for system directories (such as /usr
or /var
), specify them after the initial /
.
Warning: That does not include files created by package scripts. For instance:
/etc/hosts.allow
is not listed anywhere but it might come fromlibwrap0
that possibly created it, if that file didn't exist at time of the package installation.- Many files are compiled during installation, for example
.pyc
files (compiled Python libraries),.elc
files (compiled Emacs Lisp librarires), etc. - …
errorfind: argument list too long
– naught101
Aug 16 at 4:14
@naught101 That suggests there are a gazillion files matching/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.
– Patrice Levesque
Aug 20 at 19:32
add a comment |
In /var/lib/dpkg/info
are .list
text files that list all the files contained in each package¹ installed through Debian's package manager.
Finding all files in the filesystem not matching any entry there can be achieved with something naïve like this:
find / -xdev -type f ( -exec grep -xq "{}" /var/lib/dpkg/info/*.list ; -or -print )
This will obviously take a very long time as the whole filesystem will be scanned. If you use different partitions for system directories (such as /usr
or /var
), specify them after the initial /
.
Warning: That does not include files created by package scripts. For instance:
/etc/hosts.allow
is not listed anywhere but it might come fromlibwrap0
that possibly created it, if that file didn't exist at time of the package installation.- Many files are compiled during installation, for example
.pyc
files (compiled Python libraries),.elc
files (compiled Emacs Lisp librarires), etc. - …
errorfind: argument list too long
– naught101
Aug 16 at 4:14
@naught101 That suggests there are a gazillion files matching/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.
– Patrice Levesque
Aug 20 at 19:32
add a comment |
In /var/lib/dpkg/info
are .list
text files that list all the files contained in each package¹ installed through Debian's package manager.
Finding all files in the filesystem not matching any entry there can be achieved with something naïve like this:
find / -xdev -type f ( -exec grep -xq "{}" /var/lib/dpkg/info/*.list ; -or -print )
This will obviously take a very long time as the whole filesystem will be scanned. If you use different partitions for system directories (such as /usr
or /var
), specify them after the initial /
.
Warning: That does not include files created by package scripts. For instance:
/etc/hosts.allow
is not listed anywhere but it might come fromlibwrap0
that possibly created it, if that file didn't exist at time of the package installation.- Many files are compiled during installation, for example
.pyc
files (compiled Python libraries),.elc
files (compiled Emacs Lisp librarires), etc. - …
In /var/lib/dpkg/info
are .list
text files that list all the files contained in each package¹ installed through Debian's package manager.
Finding all files in the filesystem not matching any entry there can be achieved with something naïve like this:
find / -xdev -type f ( -exec grep -xq "{}" /var/lib/dpkg/info/*.list ; -or -print )
This will obviously take a very long time as the whole filesystem will be scanned. If you use different partitions for system directories (such as /usr
or /var
), specify them after the initial /
.
Warning: That does not include files created by package scripts. For instance:
/etc/hosts.allow
is not listed anywhere but it might come fromlibwrap0
that possibly created it, if that file didn't exist at time of the package installation.- Many files are compiled during installation, for example
.pyc
files (compiled Python libraries),.elc
files (compiled Emacs Lisp librarires), etc. - …
edited Jan 19 '16 at 12:34
Victor Ashik
1233
1233
answered Sep 2 '14 at 7:46
Patrice Levesque
1,05976
1,05976
errorfind: argument list too long
– naught101
Aug 16 at 4:14
@naught101 That suggests there are a gazillion files matching/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.
– Patrice Levesque
Aug 20 at 19:32
add a comment |
errorfind: argument list too long
– naught101
Aug 16 at 4:14
@naught101 That suggests there are a gazillion files matching/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.
– Patrice Levesque
Aug 20 at 19:32
error
find: argument list too long
– naught101
Aug 16 at 4:14
error
find: argument list too long
– naught101
Aug 16 at 4:14
@naught101 That suggests there are a gazillion files matching
/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.– Patrice Levesque
Aug 20 at 19:32
@naught101 That suggests there are a gazillion files matching
/var/lib/dpkg/info/*.list
— above query would need to be rewritten under some other principle.– Patrice Levesque
Aug 20 at 19:32
add a comment |
A more efficient version of @Patrice's solution, using a shell with support for process substitution (bash
, AT&T ksh
, zsh
):
(
export LC_ALL=C
comm -23 <(find / -xdev -type f | sort)
<(sort -u /var/lib/dpkg/info/*.list)
)
Like Patrice's solution, it assumes no file path contains newline characters.
1
Would using thelocate
database be faster than runningfind
?locate * | grep -v "^/home/"
- also has the benefit of looking in/boot/
and other system partitions.
– naught101
Jun 6 at 3:45
add a comment |
A more efficient version of @Patrice's solution, using a shell with support for process substitution (bash
, AT&T ksh
, zsh
):
(
export LC_ALL=C
comm -23 <(find / -xdev -type f | sort)
<(sort -u /var/lib/dpkg/info/*.list)
)
Like Patrice's solution, it assumes no file path contains newline characters.
1
Would using thelocate
database be faster than runningfind
?locate * | grep -v "^/home/"
- also has the benefit of looking in/boot/
and other system partitions.
– naught101
Jun 6 at 3:45
add a comment |
A more efficient version of @Patrice's solution, using a shell with support for process substitution (bash
, AT&T ksh
, zsh
):
(
export LC_ALL=C
comm -23 <(find / -xdev -type f | sort)
<(sort -u /var/lib/dpkg/info/*.list)
)
Like Patrice's solution, it assumes no file path contains newline characters.
A more efficient version of @Patrice's solution, using a shell with support for process substitution (bash
, AT&T ksh
, zsh
):
(
export LC_ALL=C
comm -23 <(find / -xdev -type f | sort)
<(sort -u /var/lib/dpkg/info/*.list)
)
Like Patrice's solution, it assumes no file path contains newline characters.
edited Apr 13 '17 at 12:36
Community♦
1
1
answered Jan 19 '16 at 15:18
Stéphane Chazelas
299k54563913
299k54563913
1
Would using thelocate
database be faster than runningfind
?locate * | grep -v "^/home/"
- also has the benefit of looking in/boot/
and other system partitions.
– naught101
Jun 6 at 3:45
add a comment |
1
Would using thelocate
database be faster than runningfind
?locate * | grep -v "^/home/"
- also has the benefit of looking in/boot/
and other system partitions.
– naught101
Jun 6 at 3:45
1
1
Would using the
locate
database be faster than running find
? locate * | grep -v "^/home/"
- also has the benefit of looking in /boot/
and other system partitions.– naught101
Jun 6 at 3:45
Would using the
locate
database be faster than running find
? locate * | grep -v "^/home/"
- also has the benefit of looking in /boot/
and other system partitions.– naught101
Jun 6 at 3:45
add a comment |
Since you tagged you question with debian
the obvious choice not mentioned yet is to use cruft-ng
if you don't require any flexibility or cruft
if you don't want to search through the whole system/locatedb.
add a comment |
Since you tagged you question with debian
the obvious choice not mentioned yet is to use cruft-ng
if you don't require any flexibility or cruft
if you don't want to search through the whole system/locatedb.
add a comment |
Since you tagged you question with debian
the obvious choice not mentioned yet is to use cruft-ng
if you don't require any flexibility or cruft
if you don't want to search through the whole system/locatedb.
Since you tagged you question with debian
the obvious choice not mentioned yet is to use cruft-ng
if you don't require any flexibility or cruft
if you don't want to search through the whole system/locatedb.
answered 1 hour ago
stefanct
1084
1084
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f153260%2fhow-to-find-files-that-are-not-owned-by-any-package%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown