This is a simple reminder that you can use basic system utilities to parse text files, extract, filter and concatenate data.
Search for heroes
package.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2- | \ tr -d " " | \ paste -d " " - - | \ grep --word-regexp heroes | \ column --table
heroes 0.21-18 heroes-data 1.5-4 heroes-sound-effects 1.0-6 heroes-sound-tracks 1.0-6
List package versions in experimental non-free repository.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/deb.debian.org_debian_dists_experimental_non-free_*_Packages | \ cut -d: -f2- | \ tr -d " " | \ paste -d " " - - | \ column --table
dwarf-fortress 0.47.05+dfsg1-1 dwarf-fortress-data 0.47.05+dfsg1-1 libaccinj64-11.5 11.5.114~11.5.2-1 libcublas11 11.7.4.6~11.5.2-1 libcublaslt11 11.7.4.6~11.5.2-1 libcudart11.0 11.5.117~11.5.2-1 libcufft10 11.1.1+~10.6.0.107~11.5.2-1 libcufftw10 11.1.1+~10.6.0.107~11.5.2-1 libcuinj64-11.5 11.5.114~11.5.2-1 libcupti-dev 11.5.114~11.5.2-1 libcupti-doc 11.5.114~11.5.2-1 libcupti11.5 11.5.114~11.5.2-1 libcurand10 11.1.1+~10.2.7.107~11.5.2-1 libcusolver11 11.3.2.107~11.5.2-1 libcusolvermg11 11.3.2.107~11.5.2-1 libcusparse11 11.7.0.107~11.5.2-1 libnppc11 11.5.1.107~11.5.2-1 libnppial11 11.5.1.107~11.5.2-1 libnppicc11 11.5.1.107~11.5.2-1 libnppidei11 11.5.1.107~11.5.2-1 libnppif11 11.5.1.107~11.5.2-1 libnppig11 11.5.1.107~11.5.2-1 libnppim11 11.5.1.107~11.5.2-1 libnppist11 11.5.1.107~11.5.2-1 libnppisu11 11.5.1.107~11.5.2-1 libnppitc11 11.5.1.107~11.5.2-1 libnpps11 11.5.1.107~11.5.2-1 libnvblas11 11.7.4.6~11.5.2-1 libnvidia-ml-dev 11.5.50~11.5.2-1 libnvjpeg11 11.5.4.107~11.5.2-1 libnvrtc-builtins11.5 11.5.119~11.5.2-1 libnvrtc11.2 11.5.119~11.5.2-1 libnvtoolsext1 11.5.114~11.5.2-1 libnvvm4 11.5.119~11.5.2-1 nsight-compute 2021.3.1.4~11.5.2-1 nsight-compute-target 2021.3.1.4~11.5.2-1 nsight-systems 2021.3.3.2~11.5.2-1 nsight-systems-target 2021.3.3.2~11.5.2-1 nvidia-cuda-dev 11.5.2-1 nvidia-cuda-gdb 11.5.114~11.5.2-1 nvidia-cuda-toolkit 11.5.2-1 nvidia-cuda-toolkit-doc 11.5.2-1 nvidia-cuda-toolkit-gcc 11.5.2-1 nvidia-opencl-dev 11.5.2-1 nvidia-openjdk-8-jre 9.+8u332-ga-1~11.5.2-1 nvidia-profiler 11.5.114~11.5.2-1 nvidia-visual-profiler 11.5.126~11.5.2-1 libcuda1 510.73.08-3 libegl-nvidia0 510.73.08-3 libgl1-nvidia-glvnd-glx 510.73.08-3 libgles-nvidia1 510.73.08-3 libgles-nvidia2 510.73.08-3 libglx-nvidia0 510.73.08-3 libnvcuvid1 510.73.08-3 libnvidia-allocator1 510.73.08-3 libnvidia-cfg1 510.73.08-3 libnvidia-compiler 510.73.08-3 libnvidia-eglcore 510.73.08-3 libnvidia-encode1 510.73.08-3 libnvidia-fbc1 510.73.08-3 libnvidia-glcore 510.73.08-3 libnvidia-glvkspirv 510.73.08-3 libnvidia-ml1 510.73.08-3 libnvidia-ngx1 510.73.08-3 libnvidia-nvvm4 510.73.08-3 libnvidia-opticalflow1 510.73.08-3 libnvidia-ptxjitcompiler1 510.73.08-3 libnvidia-rtcore 510.73.08-3 libnvoptix1 510.73.08-3 nvidia-alternative 510.73.08-3 nvidia-detect 510.73.08-3 nvidia-driver 510.73.08-3 nvidia-driver-bin 510.73.08-3 nvidia-driver-libs 510.73.08-3 nvidia-egl-common 510.73.08-3 nvidia-egl-icd 510.73.08-3 nvidia-kernel-dkms 510.73.08-3 nvidia-kernel-source 510.73.08-3 nvidia-kernel-support 510.73.08-3 nvidia-legacy-check 510.73.08-3 nvidia-libopencl1 510.73.08-3 nvidia-nonglvnd-vulkan-common 510.73.08-3 nvidia-opencl-common 510.73.08-3 nvidia-opencl-icd 510.73.08-3 nvidia-smi 510.73.08-3 nvidia-vdpau-driver 510.73.08-3 nvidia-vulkan-common 510.73.08-3 nvidia-vulkan-icd 510.73.08-3 xserver-xorg-video-nvidia 510.73.08-3 scribus-ng-doc 1.5.5+dfsg-1+transition
How it works?
List package information.
$ cat /var/lib/apt/lists/*_Packages
[...] Package: heroes Version: 0.21-18 Installed-Size: 637 Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> Architecture: amd64 Replaces: heroes-common, heroes-sdl Provides: heroes-common, heroes-sdl Depends: heroes-data, libc6 (>= 2.15), libsdl-mixer1.2, libsdl1.2debian (>= 1.2.11) Recommends: heroes-sound-effects, heroes-sound-tracks Breaks: heroes-common (<< 0.21-11~), heroes-sdl (<< 0.21-11~) Description: Collect powerups and avoid your opponents' trails Homepage: http://heroes.sourceforge.net Description-md5: 6acee3293d99f22cc69084aab068c7b2 Tag: game::arcade, interface::graphical, interface::x11, role::program, uitoolkit::sdl, use::gameplaying, x11::application Section: games Priority: optional Filename: pool/main/h/heroes/heroes_0.21-18_amd64.deb Size: 233980 MD5sum: ef25d3e80c40b71e746f7ac9371c97a6 SHA256: f020981d69feed7b7345d9f0da04fa38d4ecc884eac86de3b0c14721f34c9c98 Package: heroes-data Version: 1.5-4 Installed-Size: 2349 Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> Architecture: all Recommends: heroes-common Description: Required data files for heroes Multi-Arch: foreign Homepage: http://heroes.sourceforge.net Description-md5: 72f3d9cf070a5b1299343a6965d94835 Tag: game::arcade, role::app-data, use::gameplaying Section: games Priority: optional Filename: pool/main/h/heroes-data/heroes-data_1.5-4_all.deb Size: 297916 MD5sum: 9e9652137a8fa8cfd00e785efd7d6be3 SHA256: 5d3f6bae5fcc02e96dfd88de25e2f0ca85601be1bae645b5b3e5f41b324a7644 Package: heroes-sound-effects Version: 1.0-6 Installed-Size: 603 Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> Architecture: all Recommends: heroes Description: Optional sound files for heroes Multi-Arch: foreign Homepage: http://heroes.sourceforge.net Description-md5: 666f9b1a13a42d863665943894c523f2 Tag: game::arcade, role::app-data, use::gameplaying Section: games Priority: optional Filename: pool/main/h/heroes-sound-effects/heroes-sound-effects_1.0-6_all.deb Size: 336648 MD5sum: 53d055990248a068654d9be116747fb8 SHA256: e0bf5e5077257b8acc475309906d9cf910c434d2ffa582f3e4c2157dd83c0909 Package: heroes-sound-tracks Version: 1.0-6 Installed-Size: 2969 Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> Architecture: all Recommends: heroes Description: Optional sound files for heroes Multi-Arch: foreign Homepage: http://heroes.sourceforge.net Description-md5: 79062520657724ff31d0aa624ffbf1f0 Tag: game::arcade, made-of::audio, role::app-data, use::gameplaying Section: games Priority: optional Filename: pool/main/h/heroes-sound-tracks/heroes-sound-tracks_1.0-6_all.deb Size: 952336 MD5sum: aef1ce86b37e09c7756ee9d0343880e5 SHA256: b80a11d6bf5e3e7322e4bb511afa4f5d8b4dbea5b157408d1dede161c336371a [...]
Filter package name and version information.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages
[...] Package: heroes Version: 0.21-18 Package: heroes-data Version: 1.5-4 Package: heroes-sound-effects Version: 1.0-6 Package: heroes-sound-tracks Version: 1.0-6 [...]
Extract data.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2-
[...] heroes 0.21-18 heroes-data 1.5-4 heroes-sound-effects 1.0-6 heroes-sound-tracks 1.0-6 [...]
Extract data and remove space charracter.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2- | \ tr -d " "
[...] heroes 0.21-18 heroes-data 1.5-4 heroes-sound-effects 1.0-6 heroes-sound-tracks 1.0-6 [...]
Join every two lines.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2- | \ tr -d " " | \ paste -d " " - -
[...] heroes 0.21-18 heroes-data 1.5-4 heroes-sound-effects 1.0-6 heroes-sound-tracks 1.0-6 [...]
Filter data to locate specific package name.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2- | \ tr -d " " | \ paste -d " " - - | \ grep --word-regexp heroes
heroes 0.21-18 heroes-data 1.5-4 heroes-sound-effects 1.0-6 heroes-sound-tracks 1.0-6
Pretty-print data.
$ grep --no-filename "^\(Package\|Version\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2- | \ tr -d " " | \ paste -d " " - - | \ grep --word-regexp heroes | \ column --table
heroes 0.21-18 heroes-data 1.5-4 heroes-sound-effects 1.0-6 heroes-sound-tracks 1.0-6
You can extend these commands to include more information.
$ grep --no-filename "^\(Package\|Version\|Size\)" /var/lib/apt/lists/*_Packages | \ cut -d: -f2- | \ tr -d " " | \ paste -d " " - - - | \ grep -w heroes | \ column --table --table-columns "Name,Version,Size"
Name Version Size heroes 0.21-18 233980 heroes-data 1.5-4 297916 heroes-sound-effects 1.0-6 336648 heroes-sound-tracks 1.0-6 952336