How can I list all files which will be installed by an APT package?
up vote
0
down vote
favorite
This is similar to How can I list all files which have been installed by an APT package? However, I want to know which files will be installed as the package has not been installed, yet.
Example: I wanted to list all files which will be installed by APT package xorg
. In other words: all files which will possibly be created when I type apt install xorg
. However, apt-file
listed only the immediate files of xorg
- not of its dependencies:
$ apt-file list xorg
xorg: /usr/share/bug/xorg/script
xorg: /usr/share/doc/xorg/changelog.gz
xorg: /usr/share/doc/xorg/copyright
xorg: /usr/share/lintian/overrides/xorg
How can I list all associated files?
(I will add an awful bash
pipe combination as an answer. This is what I'm using right now, but its just a loop with many calls to apt-file
and therefore very, very slow. I'm looking for a better answer.)
bash shell-script debian ubuntu apt
add a comment |
up vote
0
down vote
favorite
This is similar to How can I list all files which have been installed by an APT package? However, I want to know which files will be installed as the package has not been installed, yet.
Example: I wanted to list all files which will be installed by APT package xorg
. In other words: all files which will possibly be created when I type apt install xorg
. However, apt-file
listed only the immediate files of xorg
- not of its dependencies:
$ apt-file list xorg
xorg: /usr/share/bug/xorg/script
xorg: /usr/share/doc/xorg/changelog.gz
xorg: /usr/share/doc/xorg/copyright
xorg: /usr/share/lintian/overrides/xorg
How can I list all associated files?
(I will add an awful bash
pipe combination as an answer. This is what I'm using right now, but its just a loop with many calls to apt-file
and therefore very, very slow. I'm looking for a better answer.)
bash shell-script debian ubuntu apt
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This is similar to How can I list all files which have been installed by an APT package? However, I want to know which files will be installed as the package has not been installed, yet.
Example: I wanted to list all files which will be installed by APT package xorg
. In other words: all files which will possibly be created when I type apt install xorg
. However, apt-file
listed only the immediate files of xorg
- not of its dependencies:
$ apt-file list xorg
xorg: /usr/share/bug/xorg/script
xorg: /usr/share/doc/xorg/changelog.gz
xorg: /usr/share/doc/xorg/copyright
xorg: /usr/share/lintian/overrides/xorg
How can I list all associated files?
(I will add an awful bash
pipe combination as an answer. This is what I'm using right now, but its just a loop with many calls to apt-file
and therefore very, very slow. I'm looking for a better answer.)
bash shell-script debian ubuntu apt
This is similar to How can I list all files which have been installed by an APT package? However, I want to know which files will be installed as the package has not been installed, yet.
Example: I wanted to list all files which will be installed by APT package xorg
. In other words: all files which will possibly be created when I type apt install xorg
. However, apt-file
listed only the immediate files of xorg
- not of its dependencies:
$ apt-file list xorg
xorg: /usr/share/bug/xorg/script
xorg: /usr/share/doc/xorg/changelog.gz
xorg: /usr/share/doc/xorg/copyright
xorg: /usr/share/lintian/overrides/xorg
How can I list all associated files?
(I will add an awful bash
pipe combination as an answer. This is what I'm using right now, but its just a loop with many calls to apt-file
and therefore very, very slow. I'm looking for a better answer.)
bash shell-script debian ubuntu apt
bash shell-script debian ubuntu apt
edited 2 days ago
asked Jun 21 at 0:11
Jayjayyy
1758
1758
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
This is what I'm using right now, but it might be buggy and is definitely not very performant:
apt-cache depends xorg | grep '..(Depends|Recommends): [^<]' | sed 's/[^:]*: //' | while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done | sed 's/[^:]*: //' | sort
Step-by-step:
Get list of packages which will be installed:
apt-cache depends xorg
Select the "depends" and "recommends" entries:
grep '..(Depends|Recommends): [^<]'
Strip everything except the package name:
sed 's/[^:]*: //'
If the line isn't empty, run apt-file
with each package name:
while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done
apt-file list
returns lines where each line begins with the corresponding package name for the file. Remove package name from line, which leaves only the filename:
sed 's/[^:]*: //'
Sort lines:
sort
add a comment |
up vote
1
down vote
You can feed apt-file list
a list of packages to process in one go, using
apt-file -f-
(to read from standard input). My measurements suggest that
apt-get -s install xorg | awk '/^Inst / { print $2 }' | apt-file -f- list
is over twice as fast as the same process with an apt-file
loop (using xargs
).
I post-process that with sort -k2,2
since I quite like to see the package involved.
Using apt-get -s install
instead of post-processing apt-cache depends xorg
means that all the packages which would be installed on your system are taken into account, and only those packages, including recursive dependencies. apt-cache depends xorg
only shows xorg
’s immediate dependencies and your post-processing doesn’t handle alternatives.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
This is what I'm using right now, but it might be buggy and is definitely not very performant:
apt-cache depends xorg | grep '..(Depends|Recommends): [^<]' | sed 's/[^:]*: //' | while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done | sed 's/[^:]*: //' | sort
Step-by-step:
Get list of packages which will be installed:
apt-cache depends xorg
Select the "depends" and "recommends" entries:
grep '..(Depends|Recommends): [^<]'
Strip everything except the package name:
sed 's/[^:]*: //'
If the line isn't empty, run apt-file
with each package name:
while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done
apt-file list
returns lines where each line begins with the corresponding package name for the file. Remove package name from line, which leaves only the filename:
sed 's/[^:]*: //'
Sort lines:
sort
add a comment |
up vote
1
down vote
This is what I'm using right now, but it might be buggy and is definitely not very performant:
apt-cache depends xorg | grep '..(Depends|Recommends): [^<]' | sed 's/[^:]*: //' | while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done | sed 's/[^:]*: //' | sort
Step-by-step:
Get list of packages which will be installed:
apt-cache depends xorg
Select the "depends" and "recommends" entries:
grep '..(Depends|Recommends): [^<]'
Strip everything except the package name:
sed 's/[^:]*: //'
If the line isn't empty, run apt-file
with each package name:
while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done
apt-file list
returns lines where each line begins with the corresponding package name for the file. Remove package name from line, which leaves only the filename:
sed 's/[^:]*: //'
Sort lines:
sort
add a comment |
up vote
1
down vote
up vote
1
down vote
This is what I'm using right now, but it might be buggy and is definitely not very performant:
apt-cache depends xorg | grep '..(Depends|Recommends): [^<]' | sed 's/[^:]*: //' | while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done | sed 's/[^:]*: //' | sort
Step-by-step:
Get list of packages which will be installed:
apt-cache depends xorg
Select the "depends" and "recommends" entries:
grep '..(Depends|Recommends): [^<]'
Strip everything except the package name:
sed 's/[^:]*: //'
If the line isn't empty, run apt-file
with each package name:
while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done
apt-file list
returns lines where each line begins with the corresponding package name for the file. Remove package name from line, which leaves only the filename:
sed 's/[^:]*: //'
Sort lines:
sort
This is what I'm using right now, but it might be buggy and is definitely not very performant:
apt-cache depends xorg | grep '..(Depends|Recommends): [^<]' | sed 's/[^:]*: //' | while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done | sed 's/[^:]*: //' | sort
Step-by-step:
Get list of packages which will be installed:
apt-cache depends xorg
Select the "depends" and "recommends" entries:
grep '..(Depends|Recommends): [^<]'
Strip everything except the package name:
sed 's/[^:]*: //'
If the line isn't empty, run apt-file
with each package name:
while read LINE; do [[ -z "$LINE" ]] || apt-file list "$LINE"; done
apt-file list
returns lines where each line begins with the corresponding package name for the file. Remove package name from line, which leaves only the filename:
sed 's/[^:]*: //'
Sort lines:
sort
answered Jun 21 at 0:12
Jayjayyy
1758
1758
add a comment |
add a comment |
up vote
1
down vote
You can feed apt-file list
a list of packages to process in one go, using
apt-file -f-
(to read from standard input). My measurements suggest that
apt-get -s install xorg | awk '/^Inst / { print $2 }' | apt-file -f- list
is over twice as fast as the same process with an apt-file
loop (using xargs
).
I post-process that with sort -k2,2
since I quite like to see the package involved.
Using apt-get -s install
instead of post-processing apt-cache depends xorg
means that all the packages which would be installed on your system are taken into account, and only those packages, including recursive dependencies. apt-cache depends xorg
only shows xorg
’s immediate dependencies and your post-processing doesn’t handle alternatives.
add a comment |
up vote
1
down vote
You can feed apt-file list
a list of packages to process in one go, using
apt-file -f-
(to read from standard input). My measurements suggest that
apt-get -s install xorg | awk '/^Inst / { print $2 }' | apt-file -f- list
is over twice as fast as the same process with an apt-file
loop (using xargs
).
I post-process that with sort -k2,2
since I quite like to see the package involved.
Using apt-get -s install
instead of post-processing apt-cache depends xorg
means that all the packages which would be installed on your system are taken into account, and only those packages, including recursive dependencies. apt-cache depends xorg
only shows xorg
’s immediate dependencies and your post-processing doesn’t handle alternatives.
add a comment |
up vote
1
down vote
up vote
1
down vote
You can feed apt-file list
a list of packages to process in one go, using
apt-file -f-
(to read from standard input). My measurements suggest that
apt-get -s install xorg | awk '/^Inst / { print $2 }' | apt-file -f- list
is over twice as fast as the same process with an apt-file
loop (using xargs
).
I post-process that with sort -k2,2
since I quite like to see the package involved.
Using apt-get -s install
instead of post-processing apt-cache depends xorg
means that all the packages which would be installed on your system are taken into account, and only those packages, including recursive dependencies. apt-cache depends xorg
only shows xorg
’s immediate dependencies and your post-processing doesn’t handle alternatives.
You can feed apt-file list
a list of packages to process in one go, using
apt-file -f-
(to read from standard input). My measurements suggest that
apt-get -s install xorg | awk '/^Inst / { print $2 }' | apt-file -f- list
is over twice as fast as the same process with an apt-file
loop (using xargs
).
I post-process that with sort -k2,2
since I quite like to see the package involved.
Using apt-get -s install
instead of post-processing apt-cache depends xorg
means that all the packages which would be installed on your system are taken into account, and only those packages, including recursive dependencies. apt-cache depends xorg
only shows xorg
’s immediate dependencies and your post-processing doesn’t handle alternatives.
answered 2 days ago
Stephen Kitt
161k24357433
161k24357433
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%2f450999%2fhow-can-i-list-all-files-which-will-be-installed-by-an-apt-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