Ubuntu: How to search for a package to install using apt in Terminal

If you want to install a package on your Ubuntu System and you are unsure of what is the package name like, well in such cases you can open up the Terminal app and make use of the apt search command followed by a string or a regular expression.

Say I want to look for all the available openjdk's.

# apt search ^openjdk-.*jdk$

Sorting... Done
Full Text Search... Done

openjdk-11-jdk/jammy-updates,jammy-security 11.0.19+7~us1-0ubuntu1~22.04.1 arm64
  OpenJDK Development Kit (JDK)

openjdk-17-jdk/jammy-updates,jammy-security 17.0.7+7~us1-0ubuntu1~22.04.2 arm64
  OpenJDK Development Kit (JDK)

openjdk-18-jdk/jammy-updates,jammy-security 18.0.2+9-2~22.04 arm64
  OpenJDK Development Kit (JDK)

openjdk-19-jdk/jammy-updates,jammy-security 19.0.2+7-0ubuntu3~22.04 arm64
  OpenJDK Development Kit (JDK)

openjdk-8-jdk/jammy-updates,jammy-security 8u372-ga~us1-0ubuntu1~22.04 arm64
  OpenJDK Development Kit (JDK)
search for a package to install using apt in Terminal

Facing issues? Have Questions? Post them here! I am happy to answer!

Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap