DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Google appears to be incapable of providing an answer to this, apparently only able to show what's already been installed, or names absent package versions, or multi-page, multi-line complete package descriptions, while man pages like apt-cache seem to have masked any evidence such options exist. In openSUSE, the following produces desired results for a specific package named "kernel-default":
What apt* incantations are required or available in Debian to produce similar results for such software as firefox-esr, firmware or linux-image-amd64?
Note: se is zypper shorthand for search. I don't type all that in SUSE. I have it and more aliased to zypse (substring search) and zypsex (exact match).
I knew about madison, but never found any way to get it to work for substrings, so that the exact package name doesn't need to be known ahead of time, or accurately typed:
In some in environments, aptitude is better than nothing:
Code:
# aptitude search linux-ima
i A linux-image-6.4.0-2-amd64 - Linux 6.4 for 64-bit PCs (signed)
i A linux-image-6.5.0-1-amd64 - Linux 6.5 for 64-bit PCs (signed)
i A linux-image-6.5.0-5-amd64 - Linux 6.5 for 64-bit PCs (signed)
i A linux-image-6.6.15-amd64 - Linux 6.6 for 64-bit PCs (signed)
p linux-image-6.6.15-amd64-dbg - Debug symbols for linux-image-6.6.15-amd64
p linux-image-6.6.15-amd64-unsigne - Linux 6.6 for 64-bit PCs
p linux-image-6.6.15-cloud-amd64 - Linux 6.6 for x86-64 cloud (signed)
p linux-image-6.6.15-cloud-amd64-d - Debug symbols for linux-image-6.6.15-cloud
p linux-image-6.6.15-cloud-amd64-u - Linux 6.6 for x86-64 cloud
p linux-image-6.6.15-rt-amd64 - Linux 6.6 for 64-bit PCs (signed), PREEMPT
p linux-image-6.6.15-rt-amd64-dbg - Debug symbols for linux-image-6.6.15-rt-am
p linux-image-6.6.15-rt-amd64-unsi - Linux 6.6 for 64-bit PCs, PREEMPT_RT
i linux-image-amd64 - Linux for 64-bit PCs (meta-package)
p linux-image-amd64-dbg - Debugging symbols for Linux amd64 configur
p linux-image-amd64-signed-templat - Template for signed linux-image packages f
p linux-image-cloud-amd64 - Linux for x86-64 cloud (meta-package)
p linux-image-cloud-amd64-dbg - Debugging symbols for Linux cloud-amd64 co
v linux-image-generic -
p linux-image-rt-amd64 - Linux for 64-bit PCs (meta-package)
p linux-image-rt-amd64-dbg - Debugging symbols for Linux rt-amd64 confi
#
In others, it's useless:
Code:
# inxi -S
System:
Host: p5bse Kernel: 6.5.0-28-generic arch: x86_64 bits: 64
Console: pty pts/0 Distro: Ubuntu 22.04.4 LTS (Jammy Jellyfish)
# aptitude search initramfs-too
i initramfs-tools - generic modular initramfs generator (autom
i initramfs-tools-bin - binaries used by initramfs-tools
p initramfs-tools-bin-dbgsym - debug symbols for initramfs-tools-bin
i A initramfs-tools-core - generic modular initramfs generator (core
p initramfs-tools-devices - Common initramfs scripts for Ubuntu Core a
v linux-initramfs-tool -
p live-boot-initramfs-tools - Live System Boot Components (initramfs-too
p tpm2-initramfs-tool - Tool used in initramfs to seal/unseal FDE
p tpm2-initramfs-tool-dbgsym - debug symbols for tpm2-initramfs-tool
#
Using --list (-l) option instead of --show (-W) gives tabular output like in your first post, however with --show one can use --showformat (-f) to change the fields and delimiters used.
What syntax reports all versions available on the mirrors? I have no problem seeing what version is installed. The question is what are available, especially when more than one version is available?
Obviously that many hits can't be what someone wanting a list of kernels can be wanting.
Code:
# apt-cache madison linux*
N: Unable to locate package linux*
# apt-cache madison linux
N: Unable to locate package linux
# apt-cache madison linux-image
# apt-cache madison linux-image-generic
linux-image-generic | 6.8.0-31.31 | http://us.archive.ubuntu.com/ubuntu noble/main amd64 Packages
#
Quote:
Originally Posted by boughtonp
Using --list (-l) option instead of --show (-W) gives tabular output like in your first post, however with --show one can use --showformat (-f) to change the fields and delimiters used.
I don't understand how this can help? I'm not looking for any help identifying installed packages, only packages that may be available. Are you suggesting dpkg-query can list both uninstalled and installed packages complete with versions?
A man page is required for choosing the appropriate man page.
I've tried man apt-cache multiple times. If the answer I need is in it, its well disguised, which leads back to the underlying question, is apt-cache appropriate to task, and if not, which binary is, or, does one even exist?
I doubt a complete version list is obtainable through Apt because there's no reason for Debian Stable to care about (e.g.) v6.7.12+1 of linux-signed-amd64 because that version will never be in the Stable repositories.
However, once you know a package what you can do is read the download location (through apt info or the first icon in the "versioned links" section of the tracker page) and then browse to the relevant directory in the shared pool, i.e: //deb.debian.org/debian/pool/main/f/firefox-esr/ which for Firefox contains a lot of crap, but can be filtered on the .dsc files to see which versions are there.
For non-Debian repositories if they have followed Debian's lead with browsable directories then you can do the same. If they block it, as Brian Havard's repo appears to, then it doesn't help - but then how would any potential Apt command get at that information, if the repo owner has blocked it...?
Do you have a real problem to solve, or are you simply Apt bashing?
Surely as long as Debian has existed there must by now be some simple enough formula to generate a packages list similar in content to that of zypper in comment #1:
Quote:
# zypper se -sx kernel-default | grep -v src
zypper: wrapper command in openSUSE and SLE which is to rpm as in Fedora DNF or YUM is to rpm, or in Debian apt or apt-* or aptitude is to dpkg
se: short form of search (query) command; Search for packages matching any of the given search strings. * and ? wildcard characters can be used within search strings. If the search string is enclosed in / (e.g. /^k.*e$/) it’s interpreted as a regular expression.
-s: aka --details; Show all available versions of matching packages, each version in each repository on a separate line.
(-)x: aka --match-exact; Searches for an exact name of the package.
kernel-default: string to search for
| grep -v src: exclude source packages
I routinely use zypper se through one of the following:
alias Dq='echo dpkg-query -l ; dpkg-query -l | sort | grep ' # output includes version
alias Ds='echo apt-cache search | apt-cache search ' # no version(s) shown :(
What I'm looking for apparently is/are Debian equivalent(s) to zypper's -s option for searches. By implication, only one output line permitted per listed package, which rules out apt-cache policy.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.