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


Groups > linux.debian.user > #190623 > unrolled thread

show searched packages including versions

Started byFelix Miata <mrmazda@earthlink.net>
First post2018-01-03 21:30 +0100
Last post2018-01-04 00:10 +0100
Articles 16 — 7 participants

Back to article view | Back to linux.debian.user


Contents

  show searched packages including versions Felix Miata <mrmazda@earthlink.net> - 2018-01-03 21:30 +0100
    Re: show searched packages including versions bw <bwtnguy@yahoo.com> - 2018-01-03 22:00 +0100
      Re: show searched packages including versions Felix Miata <mrmazda@earthlink.net> - 2018-01-03 22:20 +0100
        Re: show searched packages including versions Greg Wooledge <wooledg@eeg.ccf.org> - 2018-01-03 22:30 +0100
          Re: show searched packages including versions Greg Wooledge <wooledg@eeg.ccf.org> - 2018-01-03 23:00 +0100
            Re: show searched packages including versions Felix Miata <mrmazda@earthlink.net> - 2018-01-04 00:10 +0100
          Re: show searched packages including versions Felix Miata <mrmazda@earthlink.net> - 2018-01-03 23:00 +0100
        Re: show searched packages including versions Roberto C. Sánchez <roberto@debian.org> - 2018-01-03 22:30 +0100
          Re: show searched packages including versions Roberto C. Sánchez <roberto@debian.org> - 2018-01-03 23:10 +0100
        Re: show searched packages including versions bw <bwtnguy@yahoo.com> - 2018-01-04 00:30 +0100
          Re: show searched packages including versions Felix Miata <mrmazda@earthlink.net> - 2018-01-04 01:20 +0100
            Re: show searched packages including versions bw <bwtnguy@yahoo.com> - 2018-01-04 01:40 +0100
              Re: show searched packages including versions David Wright <deblis@lionunicorn.co.uk> - 2018-01-04 02:20 +0100
                Re: show searched packages including versions Brian <ad44@cityscape.co.uk> - 2018-01-04 21:00 +0100
            Re: show searched packages including versions Michael Stone <mstone@debian.org> - 2018-01-04 04:30 +0100
    Re: show searched packages including versions Michael Stone <mstone@debian.org> - 2018-01-04 00:10 +0100

#190623 — show searched packages including versions

FromFelix Miata <mrmazda@earthlink.net>
Date2018-01-03 21:30 +0100
Subjectshow searched packages including versions
Message-ID<v3XPH-3C0-9@gated-at.bofh.it>
I've had no luck finding a way to search in Debian that lists versions along
with names. In openSUSE, this is somewhat simple to discover, as zypper includes
everything in one man page rather than having various names to learn along with
separate (or not) man pages, such as apt-cache, apt-get, apt-mark, apt-file,
apt-key, aptitude and dpkg. Generally my searches are seeking whether newer
version is yet available. ATM, the goal is finding whether mc-4.8.17 or older
can readily be replaced by the current version, mc-4.8.20. Output I would like
in a form similar to what follows (from openSUSE):

# zypper se -sx firefox-esr

S  | Name        | Type       | Version      | Arch   | Repository
---+-------------+------------+--------------+--------+--------------
vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla131
vl | firefox-esr | package    | 45.8.0-1.3   | i586   | MozillaLegacy
vl | firefox-esr | package    | 38.8.0-1.22  | i586   | MozillaLegacy
vl | firefox-esr | package    | 31.8.0-1.30  | i586   | MozillaLegacy
vl | firefox-esr | package    | 17.0.11-1.49 | i586   | MozillaLegacy
vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla

Even better would show packages sorted first by version and skipping arch.

Can any similar output be provided in Debian? If yes, is there a config option
to make it default?
-- 
"Wisdom is supreme; therefore get wisdom. Whatever else you
get, get wisdom." Proverbs 4:7 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

[toc] | [next] | [standalone]


#190624

Frombw <bwtnguy@yahoo.com>
Date2018-01-03 22:00 +0100
Message-ID<v3YiJ-3VT-1@gated-at.bofh.it>
In reply to#190623

On Wed, 3 Jan 2018, Felix Miata wrote:

> I've had no luck finding a way to search in Debian that lists versions along
> with names. In openSUSE, this is somewhat simple to discover, as zypper includes
> everything in one man page rather than having various names to learn along with
> separate (or not) man pages, such as apt-cache, apt-get, apt-mark, apt-file,
> apt-key, aptitude and dpkg. Generally my searches are seeking whether newer
> version is yet available. ATM, the goal is finding whether mc-4.8.17 or older
> can readily be replaced by the current version, mc-4.8.20. Output I would like
> in a form similar to what follows (from openSUSE):
> 
> # zypper se -sx firefox-esr
> 
> S  | Name        | Type       | Version      | Arch   | Repository
> ---+-------------+------------+--------------+--------+--------------
> vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla131
> vl | firefox-esr | package    | 45.8.0-1.3   | i586   | MozillaLegacy
> vl | firefox-esr | package    | 38.8.0-1.22  | i586   | MozillaLegacy
> vl | firefox-esr | package    | 31.8.0-1.30  | i586   | MozillaLegacy
> vl | firefox-esr | package    | 17.0.11-1.49 | i586   | MozillaLegacy
> vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla
> 
> Even better would show packages sorted first by version and skipping arch.
> 
> Can any similar output be provided in Debian? If yes, is there a config option
> to make it default?

I don't expect any newer version of mc to be available on stretch, ever.  
You can see the current stable with apt show mc.  If I wanted to see 
versions of it in all releases, including backports, testing and 
unstable, I would go to https://packages.debian.org/mc this works for all 
packages.  I would never use another version with stable, except 
stable-backports.

good luck!

[toc] | [prev] | [next] | [standalone]


#190626

FromFelix Miata <mrmazda@earthlink.net>
Date2018-01-03 22:20 +0100
Message-ID<v3YC6-4jA-31@gated-at.bofh.it>
In reply to#190624
bw composed on 2018-01-03 15:50 (UTC-0500):

> On Wed, 3 Jan 2018, Felix Miata wrote:

>> I've had no luck finding a way to search in Debian that lists versions along
>> with names. In openSUSE, this is somewhat simple to discover, as zypper includes
>> everything in one man page rather than having various names to learn along with
>> separate (or not) man pages, such as apt-cache, apt-get, apt-mark, apt-file,
>> apt-key, aptitude and dpkg. Generally my searches are seeking whether newer
>> version is yet available. ATM, the goal is finding whether mc-4.8.17 or older
>> can readily be replaced by the current version, mc-4.8.20. Output I would like
>> in a form similar to what follows (from openSUSE):

>> # zypper se -sx firefox-esr

>> S  | Name        | Type       | Version      | Arch   | Repository
>> ---+-------------+------------+--------------+--------+--------------
>> vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla131
>> vl | firefox-esr | package    | 45.8.0-1.3   | i586   | MozillaLegacy
>> vl | firefox-esr | package    | 38.8.0-1.22  | i586   | MozillaLegacy
>> vl | firefox-esr | package    | 31.8.0-1.30  | i586   | MozillaLegacy
>> vl | firefox-esr | package    | 17.0.11-1.49 | i586   | MozillaLegacy
>> vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla

>> Even better would show packages sorted first by version and skipping arch.

>> Can any similar output be provided in Debian? If yes, is there a config option
>> to make it default?

> I don't expect any newer version of mc to be available on stretch, ever.  
> You can see the current stable with apt show mc.  If I wanted to see 
> versions of it in all releases, including backports, testing and 
> unstable, I would go to https://packages.debian.org/mc this works for all 
> packages.  I would never use another version with stable, except 
> stable-backports.                            
  mc was bad example. Currently booted is Jessie. Installed kernels are 3.16 and
4.8. What command shows me the newest available linux-image version available
anywhere that's been configured in sources.list?
-- 
"Wisdom is supreme; therefore get wisdom. Whatever else you
get, get wisdom." Proverbs 4:7 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

[toc] | [prev] | [next] | [standalone]


#190627

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-01-03 22:30 +0100
Message-ID<v3YLL-4nu-7@gated-at.bofh.it>
In reply to#190626
On Wed, Jan 03, 2018 at 04:15:51PM -0500, Felix Miata wrote:
>   mc was bad example. Currently booted is Jessie. Installed kernels are 3.16 and
> 4.8. What command shows me the newest available linux-image version available
> anywhere that's been configured in sources.list?

For starters, I strongly recommend you stop treating Debian like Ubuntu.
You're not *supposed* to have a billion package repositories.

That said, you may be looking for "apt-cache policy".

[toc] | [prev] | [next] | [standalone]


#190629

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2018-01-03 23:00 +0100
Message-ID<v3ZeO-4yB-17@gated-at.bofh.it>
In reply to#190627
On Wed, Jan 03, 2018 at 04:51:13PM -0500, Felix Miata wrote:
> apt-cache policy linux-image and apt-cache showpkg produce output that in no way
> resembles my OP request (searches substring from complete package name; one line
> per available package, including its version, source repo optional).

In that case, I recommend "The C Programming Language" by Kernighan
and Ritchie.

[toc] | [prev] | [next] | [standalone]


#190634

FromFelix Miata <mrmazda@earthlink.net>
Date2018-01-04 00:10 +0100
Message-ID<v40ky-5wp-23@gated-at.bofh.it>
In reply to#190629
Greg Wooledge composed on 2018-01-03 16:56 (UTC-0500):

> On Wed, Jan 03, 2018 at 04:51:13PM -0500, Felix Miata wrote:

>> apt-cache policy linux-image and apt-cache showpkg produce output that in no way
>> resembles my OP request (searches substring from complete package name; one line
>> per available package, including its version, source repo optional).

> In that case, I recommend "The C Programming Language" by Kernighan
> and Ritchie.                          

Resembles != equals. I'm four decades past learning new languages.

In simple terms, I want a search to return complete package names, base package
name with version string appended. Anything more that fits on a single line is a
bonus. Anything that routinely makes individual results require more than ~80
characters is too verbose.

Another example:

	$ grep RETT /etc/os-release
	PRETTY_NAME="Mageia 6"
	$ urpmq -y kernel-desk
	kernel-desktop-4.9.35-1.mga6
	kernel-desktop-4.9.40-1.mga6
	kernel-desktop-4.9.43-1.mga6
	kernel-desktop-4.9.50-1.mga6
	kernel-desktop-4.9.56-1.mga6
	kernel-desktop-devel-4.9.35-1.mga6
	kernel-desktop-devel-4.9.40-1.mga6
	kernel-desktop-devel-4.9.43-1.mga6
	kernel-desktop-devel-4.9.50-1.mga6
	kernel-desktop-devel-4.9.56-1.mga6
	kernel-desktop-devel-latest
	kernel-desktop-latest
	vboxadditions-kernel-desktop-latest
	virtualbox-kernel-desktop-latest
	xtables-addons-kernel-desktop-latest
-- 
"Wisdom is supreme; therefore get wisdom. Whatever else you
get, get wisdom." Proverbs 4:7 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

[toc] | [prev] | [next] | [standalone]


#190630

FromFelix Miata <mrmazda@earthlink.net>
Date2018-01-03 23:00 +0100
Message-ID<v3ZeN-4yB-15@gated-at.bofh.it>
In reply to#190627
Greg Wooledge composed on 2018-01-03 16:26 (UTC-0500):

> On Wed, Jan 03, 2018 at 04:15:51PM -0500, Felix Miata wrote:

>>   mc was bad example. Currently booted is Jessie. Installed kernels are 3.16 and
>> 4.8. What command shows me the newest available linux-image version available
>> anywhere that's been configured in sources.list?

> For starters, I strongly recommend you stop treating Debian like Ubuntu.
> You're not *supposed* to have a billion package repositories.                    

I don't do anything "like Buntu" intentionally on account of it. In fact:

	$ grep ntu /etc/hosts
	0.0.0.0 askubuntu.com
	0.0.0.0 ubuntu.com
	0.0.0.0 ubuntu.org

I don't like having *buntu/Canonical-speak polluting my browser history. :-D

> That said, you may be looking for "apt-cache policy".                 

"policy is meant to help debug issues relating to the preferences file. With no
arguments it will print out the priorities of each source. Otherwise it prints
out detailed information about the priority selection of the named package."

apt-cache policy linux-image and apt-cache showpkg produce output that in no way
resembles my OP request (searches substring from complete package name; one line
per available package, including its version, source repo optional).
-- 
"Wisdom is supreme; therefore get wisdom. Whatever else you
get, get wisdom." Proverbs 4:7 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

[toc] | [prev] | [next] | [standalone]


#190628

FromRoberto C. Sánchez <roberto@debian.org>
Date2018-01-03 22:30 +0100
Message-ID<v3YLL-4nu-9@gated-at.bofh.it>
In reply to#190626
On Wed, Jan 03, 2018 at 04:15:51PM -0500, Felix Miata wrote:
>   mc was bad example. Currently booted is Jessie. Installed kernels are 3.16 and
> 4.8. What command shows me the newest available linux-image version available
> anywhere that's been configured in sources.list?

Assuming you are on an amd64 system, then this:

apt-cache show linux-image-amd64

The package 'linux-image-amd64' is a meta package which always depend on
the latest available linux-image-* package for the architecture (in this
case, amd64).

If you are interested in knowing which repository in your sources.list
has that package available, then you want this:

apt-cache policy linux-image-amd64

Regards,

-Roberto

-- 
Roberto C. Sánchez

[toc] | [prev] | [next] | [standalone]


#190631

FromRoberto C. Sánchez <roberto@debian.org>
Date2018-01-03 23:10 +0100
Message-ID<v3Zot-4SL-3@gated-at.bofh.it>
In reply to#190628
On Wed, Jan 03, 2018 at 04:23:06PM -0500, Roberto C. Sánchez wrote:
> On Wed, Jan 03, 2018 at 04:15:51PM -0500, Felix Miata wrote:
> >   mc was bad example. Currently booted is Jessie. Installed kernels are 3.16 and
> > 4.8. What command shows me the newest available linux-image version available
> > anywhere that's been configured in sources.list?
> 
> Assuming you are on an amd64 system, then this:
> 
> apt-cache show linux-image-amd64
> 
> The package 'linux-image-amd64' is a meta package which always depend on
> the latest available linux-image-* package for the architecture (in this
> case, amd64).
> 
> If you are interested in knowing which repository in your sources.list
> has that package available, then you want this:
> 
> apt-cache policy linux-image-amd64
> 
You might also have a look at these commands:

root@debian:~# wajig describe linux-image-amd64
Package                  Description
========================-===================================================
linux-image-amd64        Linux for 64-bit PCs (meta-package)


root@debian:~# wajig statusmatch linux-image
Package                 Installed       Previous        Now             State
=======================-===============-===============-===============-=====
linux-image-4.14.0-2-amd64      N/A             N/A             4.14.7-1
linux-image-4.14.0-2-amd64-dbg  N/A             N/A             4.14.7-1
linux-image-4.14.0-2-rt-amd64   N/A             N/A             4.14.7-1
linux-image-4.14.0-2-rt-amd64-dbg       N/A             N/A             4.14.7-1
linux-image-4.9.0-4-grsec-amd64 N/A             N/A             4.9.65-2+grsecunoff1
linux-image-amd64       N/A             N/A             4.14+88
linux-image-amd64-dbg   N/A             N/A             4.14+88
linux-image-grsec-amd64 N/A             N/A             13
linux-image-rt-amd64    N/A             N/A             4.14+88
linux-image-rt-amd64-dbg        N/A             N/A             4.14+88


If you look at the second command, it contains a substring that wajig
uses to match from the list of available package names.

It would like be very simple to modify wajig to provide the additional
bits of information you want.  It is written in Python and the code is
clean and easy to ready.

Regards,

-Roberto

-- 
Roberto C. Sánchez

[toc] | [prev] | [next] | [standalone]


#190635

Frombw <bwtnguy@yahoo.com>
Date2018-01-04 00:30 +0100
Message-ID<v40DT-5D9-11@gated-at.bofh.it>
In reply to#190626

On Wed, 3 Jan 2018, Felix Miata wrote:

> What command shows me the newest available linux-image version available
> anywhere that's been configured in sources.list?

Here's a quick try at answering your question.  I'm sure there are a 
zillion ways to get the output arranged to your liking.  but really this 
is what man pages are for.  Give it a try they don't bite.

 apt-cache pkgnames linux-image
linux-image-4.9.0-4-rt-amd64
linux-image-4.9.0-3-amd64
linux-image-4.9.0-3-amd64-dbg
linux-image-4.9.0-4-amd64
linux-image-4.9.0-3-rt-amd64-dbg
linux-image-rt-amd64-dbg
linux-image-4.13.0-0.bpo.1-amd64
linux-image-4.9.0-3-rt-amd64
linux-image-4.9.0-4-amd64-dbg
linux-image-amd64
linux-image-4.9.0-4-rt-amd64-dbg
linux-image-amd64-dbg
linux-image-rt-amd64

[toc] | [prev] | [next] | [standalone]


#190636

FromFelix Miata <mrmazda@earthlink.net>
Date2018-01-04 01:20 +0100
Message-ID<v41qh-6eG-7@gated-at.bofh.it>
In reply to#190635
bw composed on 2018-01-03 18:20 (UTC-0500):

> On Wed, 3 Jan 2018, Felix Miata wrote:

>> What command shows me the newest available linux-image version available
>> anywhere that's been configured in sources.list?

> Here's a quick try at answering your question.  I'm sure there are a 
> zillion ways to get the output arranged to your liking.  but really this 
> is what man pages are for.  Give it a try they don't bite.

>  apt-cache pkgnames linux-image

Thank you! Arrangement was a red herring.

> linux-image-4.9.0-4-rt-amd64
> linux-image-4.9.0-3-amd64
> ...

apt-cache provides all I really was looking for. More, as in the openSUSE repo
or installation status ouput in OP, would simply be gravy. It's obvious from the
thread responses received so far that I did a poor job describing what I want by
using the zypper output that I did.

Worse, I should have searched efoX-eSr, to make it clear one shouldn't need to
know a package's complete and exact basename including case. This, at least on
glance, rules out Michael Stone's apt-cache madison suggestion.

The problem is discovery. Apt isn't Apt, it's apt this, apt-that, apt-foo,
apt-bar, apt-baz, etc., even simply apt! What's the name of the doc that teaches
which apt variant has the power to please? How does anyone discover the logic
reaching a desired conclusion when the information desired (here: version) in
the one of the (multiple apt) dictionaries called man pages isn't even in it?
>From (Buster's) apt-cache:

	pkgnames
	This command prints the name of each package APT knows. The optional
	argument is a prefix match to filter the name list. The output is
	suitable for use in a shell tab complete function and the output is
	generated extremely quickly. This command is best used with the
	--generate option.

How did *you* figure out to try apt-cache _pkgnames_ to get a search to include
packages' versions?
-- 
"Wisdom is supreme; therefore get wisdom. Whatever else you
get, get wisdom." Proverbs 4:7 (New Living Translation)

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata  ***  http://fm.no-ip.com/

[toc] | [prev] | [next] | [standalone]


#190637

Frombw <bwtnguy@yahoo.com>
Date2018-01-04 01:40 +0100
Message-ID<v41JD-6l8-3@gated-at.bofh.it>
In reply to#190636

On Wed, 3 Jan 2018, Felix Miata wrote:

> 
> How did *you* figure out to try apt-cache _pkgnames_ to get a search to include
> packages' versions?

well, see that's the thing.  In debian, kernel packagenames include 
the arch and ver in them.  This wouldn't work for mc for instance or other 
packages.

The criticism about the different apt commands is a good one.  I think the 
idea is to merge some of them into just 'apt' but so far all we have is 
show and search, shortcuts for apt-cache.

here's a part of manpage for apt in stretch:

> list (work-in-progress)
>           list is somewhat similar to dpkg-query --list in that it can 
>           display a list of packages satisfying certain criteria. It 
>           supports glob(7) patterns for matching package names as well 
>           as options to list installed (--installed), upgradeable 
>           (--upgradeable) or all available (--all-versions) versions.
>
>       edit-sources (work-in-progress)
>           edit-sources lets you edit your sources.list(5) files in your 
>           preferred texteditor while also providing basic sanity checks.

I didn't think about using dpkg for your problem, but it's really amazing.

[toc] | [prev] | [next] | [standalone]


#190639

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2018-01-04 02:20 +0100
Message-ID<v42ml-6Ng-3@gated-at.bofh.it>
In reply to#190637
On Wed 03 Jan 2018 at 19:33:28 (-0500), bw wrote:
> 
> 
> On Wed, 3 Jan 2018, Felix Miata wrote:
> 
> > 
> > How did *you* figure out to try apt-cache _pkgnames_ to get a search to include
> > packages' versions?
> 
> well, see that's the thing.  In debian, kernel packagenames include 
> the arch and ver in them.  This wouldn't work for mc for instance or other 
> packages.
> 
> The criticism about the different apt commands is a good one.  I think the 
> idea is to merge some of them into just 'apt' but so far all we have is 
> show and search, shortcuts for apt-cache.

s/merge/include/

The reason some of us continue to use apt-foo and would like
continued support for them is that they are stable in what
they do and what they output.

This is not meant as a criticism of apt/aptitude, but because
it's difficult to script a moving target.

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#190668

FromBrian <ad44@cityscape.co.uk>
Date2018-01-04 21:00 +0100
Message-ID<v4jQe-1AY-5@gated-at.bofh.it>
In reply to#190639
On Wed 03 Jan 2018 at 19:10:03 -0600, David Wright wrote:

> On Wed 03 Jan 2018 at 19:33:28 (-0500), bw wrote:
> > 
> > 
> > On Wed, 3 Jan 2018, Felix Miata wrote:
> > 
> > > 
> > > How did *you* figure out to try apt-cache _pkgnames_ to get a search to include
> > > packages' versions?
> > 
> > well, see that's the thing.  In debian, kernel packagenames include 
> > the arch and ver in them.  This wouldn't work for mc for instance or other 
> > packages.
> > 
> > The criticism about the different apt commands is a good one.  I think the 
> > idea is to merge some of them into just 'apt' but so far all we have is 
> > show and search, shortcuts for apt-cache.
> 
> s/merge/include/

apt also includes depends, rdepends and policy in its repertoire.

> The reason some of us continue to use apt-foo and would like
> continued support for them is that they are stable in what
> they do and what they output.

apt serves the needs of many users but it is very unlikely that support
for apt-foo would diminish.

> This is not meant as a criticism of apt/aptitude, but because
> it's difficult to script a moving target.

I've never used aptitude, but its searching abilities have been promoted
to be superior to apt-cache. Whether those capabilities could be rolled
into apt (or whether it is desirable to do so) I do not know.

-- 
Brian.

[toc] | [prev] | [next] | [standalone]


#190641

FromMichael Stone <mstone@debian.org>
Date2018-01-04 04:30 +0100
Message-ID<v44oa-87d-3@gated-at.bofh.it>
In reply to#190636
On Wed, Jan 03, 2018 at 07:17:11PM -0500, Felix Miata wrote:
>Worse, I should have searched efoX-eSr, to make it clear one shouldn't need to
>know a package's complete and exact basename including case

That part's easy--the case is lower...

>How did *you* figure out to try apt-cache _pkgnames_ to get a search to include
>packages' versions?

Well, that command doesn't show the version, and it only does a prefix 
search, not a substring search. It has a very specific intended purpose, 
and this doesn't really seem like the right use case.

Mike Stone

[toc] | [prev] | [next] | [standalone]


#190633

FromMichael Stone <mstone@debian.org>
Date2018-01-04 00:10 +0100
Message-ID<v40ky-5wp-21@gated-at.bofh.it>
In reply to#190623
On Wed, Jan 03, 2018 at 03:28:45PM -0500, Felix Miata wrote:
>I've had no luck finding a way to search in Debian that lists versions along
>with names. In openSUSE, this is somewhat simple to discover, as zypper includes
>everything in one man page rather than having various names to learn along with
>separate (or not) man pages, such as apt-cache, apt-get, apt-mark, apt-file,
>apt-key, aptitude and dpkg. Generally my searches are seeking whether newer
>version is yet available. ATM, the goal is finding whether mc-4.8.17 or older
>can readily be replaced by the current version, mc-4.8.20. Output I would like
>in a form similar to what follows (from openSUSE):
>
># zypper se -sx firefox-esr
>
>S  | Name        | Type       | Version      | Arch   | Repository
>---+-------------+------------+--------------+--------+--------------
>vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla131
>vl | firefox-esr | package    | 45.8.0-1.3   | i586   | MozillaLegacy
>vl | firefox-esr | package    | 38.8.0-1.22  | i586   | MozillaLegacy
>vl | firefox-esr | package    | 31.8.0-1.30  | i586   | MozillaLegacy
>vl | firefox-esr | package    | 17.0.11-1.49 | i586   | MozillaLegacy
>vl | firefox-esr | package    | 52.5.3-1.1   | i586   | Mozilla
>
>Even better would show packages sorted first by version and skipping arch.
>
>Can any similar output be provided in Debian? If yes, is there a config option
>to make it default?

Try "apt-cache madison firefox-esr". It's also pretty simple to write a 
python script to tweak the exact output and parameters, something like:

import apt_pkg
import sys
import re

apt_pkg.init()
cache = apt_pkg.Cache()
for pkg in sorted(cache.packages):
    if re.search(sys.argv[1], pkg.name):
        for version in sorted(pkg.version_list):
            print("%s\t%s\t%s" % (pkg.name, pkg.architecture, version.ver_str))

Which would show something like:

> /scratch/pyaptvers.py 'firefox-esr$'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
firefox-esr     amd64   52.5.0esr-1~deb9u1
firefox-esr     amd64   52.5.2esr-1~deb9u1

Mike Stone

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web