Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #208071

Re: apt pinning: find out from which system version is a package

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: apt pinning: find out from which system version is a package
Date 2019-05-03 14:50 +0200
Message-ID <xTFNv-6Xi-1@gated-at.bofh.it> (permalink)
References <xS5j3-59d-1@gated-at.bofh.it> <xSePn-2CX-3@gated-at.bofh.it> <xTvuN-Gt-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 03 May 2019 at 03:46:50 (+0200), Emanuel Berg wrote:
> David Wright wrote:
> 
> > $ apt-cache dump | grep -A 2 '^Package:' | grep -B 2 '^ File:' | sed -e 'N;N;s/\n/ /g;s/ \+/ /g;N' | grep -v '^--' | sort >> "$Unique1"
> > $ dpkg-query -W -f '^Package: ${Package} \n' | grep --file=- "$Unique1" | sort
> 
> That's some heavy parsing,

You wrote "no worries, I can make a zsh function and have them next to
each other" so I guess you're up to it …

> only I don't get it
> to work. I get "no such file or directory: "
> from the first, apt-cache-dump invocation.

… but I advise that you cut and paste.

> Maybe do a shell function of it (whatever shell
> you prefer)?

Don't think that I type this stuff into the command line itself.
This is just one part of a bash function that writes five files
to an archive, the output from dpkg -l, just the package names,
packages and versions, apt-show-versions, and the process above
which is named "origins".

These files can then be inspected, diffed etc, at leisure even
while the host concerned is not running.

> Also I don't understand where the argument
> goes? Where is ${Package} defined, even tho it
> didn't (for me) even get that far?

It's nothing to do with bash, as it's protected by '',
but see   man dpkg-query   just above 'EXIT STATUS'.

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-04-29 05:40 +0200
  Re: apt pinning: find out from which system version is a package Jonas Smedegaard <jonas@jones.dk> - 2019-04-29 07:40 +0200
    Re: apt pinning: find out from which system version is a package "Alexander V. Makartsev" <avbetev@gmail.com> - 2019-04-29 09:20 +0200
      Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 03:40 +0200
    Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 03:40 +0200
      Re: apt pinning: find out from which system version is a package Greg Wooledge <wooledg@eeg.ccf.org> - 2019-05-03 14:40 +0200
  Re: apt pinning: find out from which system version is a package David Wright <deblis@lionunicorn.co.uk> - 2019-04-29 15:50 +0200
    Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 03:50 +0200
      Re: apt pinning: find out from which system version is a package <tomas@tuxteam.de> - 2019-05-03 08:50 +0200
        Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 23:20 +0200
          Re: apt pinning: find out from which system version is a package David Wright <deblis@lionunicorn.co.uk> - 2019-05-04 17:30 +0200
      Re: apt pinning: find out from which system version is a package Greg Wooledge <wooledg@eeg.ccf.org> - 2019-05-03 14:40 +0200
      Re: apt pinning: find out from which system version is a package David Wright <deblis@lionunicorn.co.uk> - 2019-05-03 14:50 +0200
  Re: apt pinning: find out from which system version is a package Francisco M Neto <fmneto@fmneto.com.br> - 2019-04-29 23:20 +0200
    Re: apt pinning: find out from which system version is a package Toni Mas <antomassol@gmail.com> - 2019-04-29 23:20 +0200
      Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 04:10 +0200
      Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 04:10 +0200
    Re: apt pinning: find out from which system version is a package Emanuel Berg <moasenwood@zoho.eu> - 2019-05-03 04:00 +0200

csiph-web