dpkg-query placeholders âFilenameâ, âMD5sumâ and âSizeâ are always empty
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I'm currently trying to get some info about the installed pakages und systems that use dpkg
. So I tried to use dpkg-query
. Most placeholders work fine and I get what I need, however I noticed that the placeholders Filename
, MD5sum
and Size
are always empty.
Simple command to see the issue:
dpkg-query -W -f '"location":"$Filename","md5":"$MD5sum","size":"$Size"\n'
This will result in loads of lines of just
"location":"","md5":"","size":""
package-management dpkg
add a comment |Â
up vote
3
down vote
favorite
I'm currently trying to get some info about the installed pakages und systems that use dpkg
. So I tried to use dpkg-query
. Most placeholders work fine and I get what I need, however I noticed that the placeholders Filename
, MD5sum
and Size
are always empty.
Simple command to see the issue:
dpkg-query -W -f '"location":"$Filename","md5":"$MD5sum","size":"$Size"\n'
This will result in loads of lines of just
"location":"","md5":"","size":""
package-management dpkg
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I'm currently trying to get some info about the installed pakages und systems that use dpkg
. So I tried to use dpkg-query
. Most placeholders work fine and I get what I need, however I noticed that the placeholders Filename
, MD5sum
and Size
are always empty.
Simple command to see the issue:
dpkg-query -W -f '"location":"$Filename","md5":"$MD5sum","size":"$Size"\n'
This will result in loads of lines of just
"location":"","md5":"","size":""
package-management dpkg
I'm currently trying to get some info about the installed pakages und systems that use dpkg
. So I tried to use dpkg-query
. Most placeholders work fine and I get what I need, however I noticed that the placeholders Filename
, MD5sum
and Size
are always empty.
Simple command to see the issue:
dpkg-query -W -f '"location":"$Filename","md5":"$MD5sum","size":"$Size"\n'
This will result in loads of lines of just
"location":"","md5":"","size":""
package-management dpkg
edited Aug 22 at 13:00
Stephen Kitt
143k22312377
143k22312377
asked Aug 22 at 12:52
BrainStone
1,10371940
1,10371940
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
As mentioned in the manpage, these fields are âÂÂinternal, front-end relatedâÂÂ. In fact theyâÂÂre only used in dselect
.
This means you canâÂÂt rely on them in dpkg-query
, by default. They correspond to values stored in the âÂÂavailableâ database, /var/lib/dpkg/available
; dpkg-query
by default only considers /var/lib/dpkg/status
nowadays. You can add the --load-avail
option to merge the information from the âÂÂavailableâ database, in theory â but that requires using dselect
as your package installation tool, since /var/lib/dpkg/available
is only kept up-to-date by dselect
. If you use APT this wonâÂÂt work, as described in the documentation for the -p
command:
Users of APT-based frontends should use
apt-cache show package-name
instead as theavailable
file is only kept up-to-date when usingdselect
.
It might help if I expand a bit on the meaning of the fields: Filename
, MD5sum
and Size
(and MSDOS-Filename
) all give information on the file containing a package (its filename, checksum and size). They arenâÂÂt germane to the packages themselves, so the status
database doesnâÂÂt need them and doesnâÂÂt store them. A package, installed or otherwise, remains the same regardless of where its package file lives and what its characteristics are. That information is only useful for front-ends which retrieve packages and provide them to dpkg
.
I saw these in the manpages, however could not find any reference as to whatinternal
andfront-end related
mean. Also according to said mainpage they should be available.
â BrainStone
Aug 22 at 13:02
1
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
1
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@StephenKitt is there a format option forapt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...
â BrainStone
Aug 22 at 13:25
1
@BrainStone not withapt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look ataptitude search
and its-F
option.
â Stephen Kitt
Aug 22 at 13:28
 |Â
show 2 more comments
up vote
4
down vote
You can use grep-available
tool instead (or more better grep-aptavail
as mentioned @Stephen Kitt) :
grep-available -s Filename,MD5sum,size -PX <package_name>
Example:
grep-available -s Filename,MD5sum,size -PX dpkg
sample output:
Filename: pool/main/d/dpkg/dpkg_1.18.24_amd64.deb
MD5sum: 5553b3fac608f5c4f9fa3ddbff18c2c5
Size: 2106696
1
Or better yet in most cases,grep-aptavail
.
â Stephen Kitt
Aug 22 at 13:37
1
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
As mentioned in the manpage, these fields are âÂÂinternal, front-end relatedâÂÂ. In fact theyâÂÂre only used in dselect
.
This means you canâÂÂt rely on them in dpkg-query
, by default. They correspond to values stored in the âÂÂavailableâ database, /var/lib/dpkg/available
; dpkg-query
by default only considers /var/lib/dpkg/status
nowadays. You can add the --load-avail
option to merge the information from the âÂÂavailableâ database, in theory â but that requires using dselect
as your package installation tool, since /var/lib/dpkg/available
is only kept up-to-date by dselect
. If you use APT this wonâÂÂt work, as described in the documentation for the -p
command:
Users of APT-based frontends should use
apt-cache show package-name
instead as theavailable
file is only kept up-to-date when usingdselect
.
It might help if I expand a bit on the meaning of the fields: Filename
, MD5sum
and Size
(and MSDOS-Filename
) all give information on the file containing a package (its filename, checksum and size). They arenâÂÂt germane to the packages themselves, so the status
database doesnâÂÂt need them and doesnâÂÂt store them. A package, installed or otherwise, remains the same regardless of where its package file lives and what its characteristics are. That information is only useful for front-ends which retrieve packages and provide them to dpkg
.
I saw these in the manpages, however could not find any reference as to whatinternal
andfront-end related
mean. Also according to said mainpage they should be available.
â BrainStone
Aug 22 at 13:02
1
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
1
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@StephenKitt is there a format option forapt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...
â BrainStone
Aug 22 at 13:25
1
@BrainStone not withapt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look ataptitude search
and its-F
option.
â Stephen Kitt
Aug 22 at 13:28
 |Â
show 2 more comments
up vote
4
down vote
accepted
As mentioned in the manpage, these fields are âÂÂinternal, front-end relatedâÂÂ. In fact theyâÂÂre only used in dselect
.
This means you canâÂÂt rely on them in dpkg-query
, by default. They correspond to values stored in the âÂÂavailableâ database, /var/lib/dpkg/available
; dpkg-query
by default only considers /var/lib/dpkg/status
nowadays. You can add the --load-avail
option to merge the information from the âÂÂavailableâ database, in theory â but that requires using dselect
as your package installation tool, since /var/lib/dpkg/available
is only kept up-to-date by dselect
. If you use APT this wonâÂÂt work, as described in the documentation for the -p
command:
Users of APT-based frontends should use
apt-cache show package-name
instead as theavailable
file is only kept up-to-date when usingdselect
.
It might help if I expand a bit on the meaning of the fields: Filename
, MD5sum
and Size
(and MSDOS-Filename
) all give information on the file containing a package (its filename, checksum and size). They arenâÂÂt germane to the packages themselves, so the status
database doesnâÂÂt need them and doesnâÂÂt store them. A package, installed or otherwise, remains the same regardless of where its package file lives and what its characteristics are. That information is only useful for front-ends which retrieve packages and provide them to dpkg
.
I saw these in the manpages, however could not find any reference as to whatinternal
andfront-end related
mean. Also according to said mainpage they should be available.
â BrainStone
Aug 22 at 13:02
1
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
1
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@StephenKitt is there a format option forapt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...
â BrainStone
Aug 22 at 13:25
1
@BrainStone not withapt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look ataptitude search
and its-F
option.
â Stephen Kitt
Aug 22 at 13:28
 |Â
show 2 more comments
up vote
4
down vote
accepted
up vote
4
down vote
accepted
As mentioned in the manpage, these fields are âÂÂinternal, front-end relatedâÂÂ. In fact theyâÂÂre only used in dselect
.
This means you canâÂÂt rely on them in dpkg-query
, by default. They correspond to values stored in the âÂÂavailableâ database, /var/lib/dpkg/available
; dpkg-query
by default only considers /var/lib/dpkg/status
nowadays. You can add the --load-avail
option to merge the information from the âÂÂavailableâ database, in theory â but that requires using dselect
as your package installation tool, since /var/lib/dpkg/available
is only kept up-to-date by dselect
. If you use APT this wonâÂÂt work, as described in the documentation for the -p
command:
Users of APT-based frontends should use
apt-cache show package-name
instead as theavailable
file is only kept up-to-date when usingdselect
.
It might help if I expand a bit on the meaning of the fields: Filename
, MD5sum
and Size
(and MSDOS-Filename
) all give information on the file containing a package (its filename, checksum and size). They arenâÂÂt germane to the packages themselves, so the status
database doesnâÂÂt need them and doesnâÂÂt store them. A package, installed or otherwise, remains the same regardless of where its package file lives and what its characteristics are. That information is only useful for front-ends which retrieve packages and provide them to dpkg
.
As mentioned in the manpage, these fields are âÂÂinternal, front-end relatedâÂÂ. In fact theyâÂÂre only used in dselect
.
This means you canâÂÂt rely on them in dpkg-query
, by default. They correspond to values stored in the âÂÂavailableâ database, /var/lib/dpkg/available
; dpkg-query
by default only considers /var/lib/dpkg/status
nowadays. You can add the --load-avail
option to merge the information from the âÂÂavailableâ database, in theory â but that requires using dselect
as your package installation tool, since /var/lib/dpkg/available
is only kept up-to-date by dselect
. If you use APT this wonâÂÂt work, as described in the documentation for the -p
command:
Users of APT-based frontends should use
apt-cache show package-name
instead as theavailable
file is only kept up-to-date when usingdselect
.
It might help if I expand a bit on the meaning of the fields: Filename
, MD5sum
and Size
(and MSDOS-Filename
) all give information on the file containing a package (its filename, checksum and size). They arenâÂÂt germane to the packages themselves, so the status
database doesnâÂÂt need them and doesnâÂÂt store them. A package, installed or otherwise, remains the same regardless of where its package file lives and what its characteristics are. That information is only useful for front-ends which retrieve packages and provide them to dpkg
.
edited Aug 22 at 13:25
answered Aug 22 at 13:00
Stephen Kitt
143k22312377
143k22312377
I saw these in the manpages, however could not find any reference as to whatinternal
andfront-end related
mean. Also according to said mainpage they should be available.
â BrainStone
Aug 22 at 13:02
1
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
1
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@StephenKitt is there a format option forapt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...
â BrainStone
Aug 22 at 13:25
1
@BrainStone not withapt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look ataptitude search
and its-F
option.
â Stephen Kitt
Aug 22 at 13:28
 |Â
show 2 more comments
I saw these in the manpages, however could not find any reference as to whatinternal
andfront-end related
mean. Also according to said mainpage they should be available.
â BrainStone
Aug 22 at 13:02
1
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
1
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@StephenKitt is there a format option forapt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...
â BrainStone
Aug 22 at 13:25
1
@BrainStone not withapt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look ataptitude search
and its-F
option.
â Stephen Kitt
Aug 22 at 13:28
I saw these in the manpages, however could not find any reference as to what
internal
and front-end related
mean. Also according to said mainpage they should be available.â BrainStone
Aug 22 at 13:02
I saw these in the manpages, however could not find any reference as to what
internal
and front-end related
mean. Also according to said mainpage they should be available.â BrainStone
Aug 22 at 13:02
1
1
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
That isn't really clear from the man page. The man states that (emphasis mine) "The following fields are recognized but they are not necessarily available in the status file (only internal fields or fields stored in the binary package end up in it)" which would suggest that, contrary to what your answer states, it's the internal fields that will be included.
â terdonâ¦
Aug 22 at 13:03
1
1
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@terdon right, I wrote my answer based on the source code, not the documentation ;-).
â Stephen Kitt
Aug 22 at 13:19
@StephenKitt is there a format option for
apt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...â BrainStone
Aug 22 at 13:25
@StephenKitt is there a format option for
apt-cache show
too? Else the manipulation of the texts is gonna be a nightmare...â BrainStone
Aug 22 at 13:25
1
1
@BrainStone not with
apt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look at aptitude search
and its -F
option.â Stephen Kitt
Aug 22 at 13:28
@BrainStone not with
apt-cache
, but the output follows RFC 822 and is designed to be parsed. If you want a controllable format using APT-based tools, look at aptitude search
and its -F
option.â Stephen Kitt
Aug 22 at 13:28
 |Â
show 2 more comments
up vote
4
down vote
You can use grep-available
tool instead (or more better grep-aptavail
as mentioned @Stephen Kitt) :
grep-available -s Filename,MD5sum,size -PX <package_name>
Example:
grep-available -s Filename,MD5sum,size -PX dpkg
sample output:
Filename: pool/main/d/dpkg/dpkg_1.18.24_amd64.deb
MD5sum: 5553b3fac608f5c4f9fa3ddbff18c2c5
Size: 2106696
1
Or better yet in most cases,grep-aptavail
.
â Stephen Kitt
Aug 22 at 13:37
1
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
add a comment |Â
up vote
4
down vote
You can use grep-available
tool instead (or more better grep-aptavail
as mentioned @Stephen Kitt) :
grep-available -s Filename,MD5sum,size -PX <package_name>
Example:
grep-available -s Filename,MD5sum,size -PX dpkg
sample output:
Filename: pool/main/d/dpkg/dpkg_1.18.24_amd64.deb
MD5sum: 5553b3fac608f5c4f9fa3ddbff18c2c5
Size: 2106696
1
Or better yet in most cases,grep-aptavail
.
â Stephen Kitt
Aug 22 at 13:37
1
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
add a comment |Â
up vote
4
down vote
up vote
4
down vote
You can use grep-available
tool instead (or more better grep-aptavail
as mentioned @Stephen Kitt) :
grep-available -s Filename,MD5sum,size -PX <package_name>
Example:
grep-available -s Filename,MD5sum,size -PX dpkg
sample output:
Filename: pool/main/d/dpkg/dpkg_1.18.24_amd64.deb
MD5sum: 5553b3fac608f5c4f9fa3ddbff18c2c5
Size: 2106696
You can use grep-available
tool instead (or more better grep-aptavail
as mentioned @Stephen Kitt) :
grep-available -s Filename,MD5sum,size -PX <package_name>
Example:
grep-available -s Filename,MD5sum,size -PX dpkg
sample output:
Filename: pool/main/d/dpkg/dpkg_1.18.24_amd64.deb
MD5sum: 5553b3fac608f5c4f9fa3ddbff18c2c5
Size: 2106696
edited Aug 22 at 13:47
answered Aug 22 at 13:34
GAD3R
22.7k154895
22.7k154895
1
Or better yet in most cases,grep-aptavail
.
â Stephen Kitt
Aug 22 at 13:37
1
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
add a comment |Â
1
Or better yet in most cases,grep-aptavail
.
â Stephen Kitt
Aug 22 at 13:37
1
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
1
1
Or better yet in most cases,
grep-aptavail
.â Stephen Kitt
Aug 22 at 13:37
Or better yet in most cases,
grep-aptavail
.â Stephen Kitt
Aug 22 at 13:37
1
1
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
I think this is a great answer for the general public, but not for me, as I need a portable solution. (That's why I won't accept it)
â BrainStone
Aug 22 at 13:42
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464117%2fdpkg-query-placeholders-filename-md5sum-and-size-are-always-empty%23new-answer', 'question_page');
);
Post as a guest
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
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
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