Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #191054
| From | john doe <johndoe65534@mail.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: scriptable way to list packages that are not installed |
| Date | 2018-01-14 07:40 +0100 |
| Message-ID | <v7K7v-8kR-1@gated-at.bofh.it> (permalink) |
| References | <v7HCF-6FF-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 1/14/2018 4:52 AM, Vasyl Vavrychuk wrote:
> I would like to list not installed packages in my script. Currently I do
>
> dpkg-query -W -f='${db:Status-Abbrev}${binary:Package}\n'
> $PACKAGES | grep -v "^ii" | awk '{print $2}'
>
As an aside; you don't need grep in this command:
$ <CMD> | awk '!/^ii/{print $2}'
> Problem is that dpkg-query outputs information about no matching
> packages in stderr in a not suitable for scripts way, for example
>
> dpkg-query -W -f='${db:Status-Abbrev}${binary:Package}\n' git gawk cmake
> un cmake
> ii git
> dpkg-query: no packages found matching gawk
>
> I there any scriptable way to get information about unmatching packages?
>
You could try to redirect STDERR to STDOUT:
$ dpkg-query -W -f='${db:Status-Abbrev}${binary:Package}\n' git gawk
cmake 2>&1 | awk '{print $6}'
git
gawk
cmake
Note that my mailer is folding the command.
--
John Doe
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
scriptable way to list packages that are not installed Vasyl Vavrychuk <vvavrychuk@gmail.com> - 2018-01-14 05:00 +0100
Re: scriptable way to list packages that are not installed john doe <johndoe65534@mail.com> - 2018-01-14 07:40 +0100
Re: scriptable way to list packages that are not installed john doe <johndoe65534@mail.com> - 2018-01-14 07:50 +0100
Re: scriptable way to list packages that are not installed Vasyl Vavrychuk <vvavrychuk@gmail.com> - 2018-01-14 21:20 +0100
Re: scriptable way to list packages that are not installed Michael Lange <klappnase@freenet.de> - 2018-01-14 23:10 +0100
Re: scriptable way to list packages that are not installed davidson <davidson@freevolt.org> - 2018-01-16 20:40 +0100
Re: scriptable way to list packages that are not installed davidson@freevolt.org - 2018-01-16 21:00 +0100
Re: scriptable way to list packages that are not installed Charlie Gibbs <cgibbs@surfnaked.ca> - 2018-01-17 03:20 +0100
Re: scriptable way to list packages that are not installed The Wanderer <wanderer@fastmail.fm> - 2018-01-17 05:20 +0100
Re: scriptable way to list packages that are not installed John Hasler <jhasler@newsguy.com> - 2018-01-17 05:50 +0100
Re: scriptable way to list packages that are not installed Darac Marjal <mailinglist@darac.org.uk> - 2018-01-17 20:40 +0100
Re: scriptable way to list packages that are not installed davidson <davidson@freevolt.org> - 2018-01-17 21:10 +0100
Re: scriptable way to list packages that are not installed Charlie Gibbs <cgibbs@surfnaked.ca> - 2018-01-18 07:20 +0100
Re: scriptable way to list packages that are not installed davidson <davidson@freevolt.org> - 2018-01-16 22:40 +0100
Re: scriptable way to list packages that are not installed Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> - 2018-01-14 11:40 +0100
Re: scriptable way to list packages that are not installed Roberto C. Sánchez <roberto@debian.org> - 2018-01-14 14:00 +0100
Re: scriptable way to list packages that are not installed Bernd Gruber <begruber@mnet-online.de> - 2018-01-14 16:00 +0100
csiph-web