0

apt-cache search jdk returns zero results before apt-get update but several results after the update although the update output makes no mention of jdk installs. I am trying to find what I am missing.

I fire up a Ubuntu Docker container on the command line (docker run --rm -it ubuntu bash). A JDK search yields no results:

root@2bc9920836d1:/# apt-cache search jdk
root@2bc9920836d1:/#

I update:

root@2bc9920836d1:/# apt-get update
Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [109 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [84.2 kB]
Get:5 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [61.0 kB]
Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [90.7 kB]
Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:8 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [61.3 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:12 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [97.6 kB]
Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [68.6 kB]
Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [157 kB]
Fetched 20.8 MB in 56s (374 kB/s)
Reading package lists... Done

Then search for JDK:

root@2bc9920836d1:/# apt-cache search jdk
default-jdk - Standard Java or Java compatible Development Kit
default-jdk-doc - Standard Java or Java compatible Development Kit (documentation)
default-jdk-headless - Standard Java or Java compatible Development Kit (headless)
openjdk-11-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-11-doc - OpenJDK Development Kit (JDK) documentation
...

Apparently, the JDK was installed during the update. But the output of update doesn't say anything anything to the effect of having installed a jdk. What am I missing here?

PS:

root@2bc9920836d1:/# cat /etc/issue
Ubuntu 22.04 LTS \n \l # Before and after update

root@2bc9920836d1:/#

1 Answers1

4

apt-get update doesn't install anything.

It updates package lists. So it is expected. After you updated the list, you can see available packages.

Pilot6
  • 90,100
  • 91
  • 213
  • 324