(the below is from Ubuntu, but the same technique obviously works on Debian as well)
$ apt-cache show screen
Package: screen
Priority: optional
Section: misc
Installed-Size: 950
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Axel Beckert <[email protected]>
Architecture: amd64
Version: 4.1.0~20120320gitdb59704-9
Depends: libc6 (>= 2.15), libpam0g (>= 0.99.7.1), libtinfo5
Suggests: iselect (>= 1.4.0-1) | screenie | byobu
Filename: pool/main/s/screen/screen_4.1.0~20120320gitdb59704-9_amd64.deb
Size: 645730
...
If the package exists, information will be displayed. If not, you'll see something like:
$ apt-cache show foobar
N: Unable to locate package foobar
E: No packages found
Additionally, the exit code of apt-cache
will be non-zero if no matching packages are found.
Additional note: If you're using apt-cache show package
where package is a virtual one (one that doesn't exist, but is, for example, referenced by other packages), you'll get:
N: Can't select versions from package 'package' as it is purely virtual
N: No packages found
The exit code
of this is zero (which is a bit misleading in my opinion.)
--force-yes
deactivates all security, so you really could break your system to the point of no repair. Also:--force-yes
overrides (deactivates)-y
. where the latter could be the option of choice: A long form of-y
is--assume-yes
, and that's what it does; Saying yes until it could get really ugly, with risking havoc among core elements, fundamentals, etc.--force
overrides breaks security (learned it the hard way)--simulate
option forapt-get
, to do a--dry-run
, just in case/etc/apt/sources.list
, right?