0

OS : Debian latest.

Hello friends,

I am working on a small tool, where I am required to send the list of manually installed packages installed for a system as a text file. This text file is then pulled up by another agent. Currently, I am able to get the list via below mentioned command, but it does not give me the version number. Any idea how I can get the version number along with it. Thank you.

Command:

comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz | sed -n 's/^Package: //p' | sort -u) 

Kindly let me know. Thank you.

1

Depending on your exact use-case, zgrep may do the trick:

zgrep ... /var/log/dpkg.log* | grep installed

(Note that the three dots ... are required)

0

You can pipe the output to dpkg -s:

comm -23 <(apt-mark showmanual | sort -u) <(gzip -dc /var/log/installer/initial-status.gz  \| 
sed -n 's/^Package: //p' | sort -u) | xargs -n1 dpkg -s |grep 'Package:\|Version:'
0

For me it worked out with the following:

dpkg-query -l | awk '{print $2 " Version Number " $3}'
1
  • There is a big difference between this command and the given one in your question. Use diff to see the difference.
    – GAD3R
    May 7 '21 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.