Searching for the software packages (apt-cache)

This recipe shows how to search for the software packages using apt-cache.

The "official" Raspbian Linux distribution contains a large number of prebuilt software packages, ready to be downloaded and installed. The distributed software packages cover a wide range of uses including utilities for administering and securing the Raspberry Pi. Using the apt-cache command, this large repository can be searched for keywords.

Once you've completed this recipe, you will be able locate software packages by keyword using the apt-cache search command.

Getting ready

The following are the ingredients:

  • A Raspberry Pi with a 5V power supply
  • An installed and configured "official" Raspbian Linux SD card
  • A network connection

If the Raspberry Pi's Secure Shell server is running, this recipe can be completed remotely using a Secure Shell client.

The Raspberry Pi will need access to the Internet to reach the update server(s) from which it will pull the software updates.

How to do it...

The steps for searching the Raspbian Linux software packages are as follows:

  1. Log in to the Raspberry Pi either directly or remotely.
  2. Execute the following command:
    apt-cache search fortune –names-only
    

    Searching the cache does not require privileges.

    How to do it...

    The preceding screenshot shows how the apt-cache command is used to search for packages with fortune in their names.

  3. The command displays a list of packages with "fortune" in the package name.

How it works...

In this recipe, the configured Raspberry Pi distributions are searched for packages that have the keyword "fortune" in their package name.

When apt-cache command is run without the option -names-only, the command summary is also searched.

Of the packages found, the package fortune-mod is a command-line utility that provides fortune cookies on demand. The packages that begin with fortunes- are the collections of fortunes that the command-line utility selects from when displaying a fortune cookie on demand.

Instructions on how to install the fortune package are in the next recipe.

See also

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.214.215