Linux apt get find

How do I find packages to install via apt-get

After doing a man apt-get and cursory Google search it’s not clear how I find new programs to install (from the internet) using apt-get (which is amazingly powerful and simple coming from another Linux distro). I’m using Ubuntu Server 8.04 LTS (an inherited system used for some random work), so no GUI. Anyone have quick advice here?

8 Answers 8

Also you can use apt-cache search for command-line searching. Or you can use the GUI package manager (Ubuntu Software Center / Synaptic) for searching software.

If you search for «nvidia settings».

apt-cache search nvidia settings 
nvidia-settings - Werkzeug für die Konfiguration des NVIDIA-Grafiktreibers nvidia-settings-updates - Tool of configuring the NVIDIA graphics driver 

You see 2 packages nvidia-settings and nvidia-settings-updates .

To find the related binary to the package nvidia-settings .

dpkg -L nvidia-settings | grep bin 
/usr/bin /usr/lib/nvidia-settings/bin /usr/lib/nvidia-settings/bin/nvidia-settings 

nvidia-settings is the binary name to start the program.

With binaries in particular there is an application that is automatically run if you run a command that is not installed. For example,

$ bonnie++ The program 'bonnie++' is currently not installed. You can install it by typing: sudo apt-get install bonnie++ 

Other than that, there are searches: apt-cache search or aptitude search which can be preferable if you want to get really involved with filters.

You can try the program ‘aptitude’ from the command line. It is a graphical package manager. Remember to append sudo to the program to do any real installations. ‘sudo aptitude’. You can also use aptitude just like apt-get; «sudo aptitude install». I prefer apt-get for single packages that I know the names for.

Читайте также:  Creating daemon process in linux

Also, are you just on a command line? If you have a desktop you can use System -> Preferences -Synaptic, or the Ubuntu Software Center. They function nearly the same however they have a simpler package search.

I find the Software Center most useful with Google a close second when I know what I want but don’t know a package name. (And the Meerkat Software Center is new, improved and more Googly).

I think, you are referring to the binary program name included in the package. I use this technique to find this:

simply type dpkg -L in a terminal, it will display all files installed by that package, then you can recognize the binary program names by looking at their location. Usually programs are installed in /usr/bin directory or /sbin directory.

anwar@edubuntu-lenovo:~$ dpkg -L gnome-screenshot /. /usr /usr/bin /usr/bin/gnome-screenshot /usr/share /usr/share/GConf /usr/share/GConf/gsettings /usr/share/GConf/gsettings/gnome-screenshot.convert /usr/share/applications /usr/share/applications/gnome-screenshot.desktop /usr/share/man /usr/share/man/man1 /usr/share/man/man1/gnome-screenshot.1.gz /usr/share/gnome-screenshot /usr/share/gnome-screenshot/gnome-screenshot.ui /usr/share/glib-2.0 /usr/share/glib-2.0/schemas /usr/share/glib-2.0/schemas/org.gnome.gnome-screenshot.gschema.xml /usr/share/doc /usr/share/doc/gnome-screenshot /usr/share/doc/gnome-screenshot/copyright /usr/share/doc/gnome-screenshot/NEWS.gz /usr/share/doc/gnome-screenshot/changelog.Debian.gz 

Note that, the program name of gnome-screenshot package is gnome-screenshot .

Is there any standard way to know the for the desired program?

Sometimes the terminal can tell your the package name required to be installed to have a desired program. It happens when the program is in Standard repository and you have enabled those repository.

For example, If I type gnome-documents when no such package is installed, the terminal will tell be this:

anwar@edubuntu-lenovo:~$ gnome-documents The program 'gnome-documents' is currently not installed. You can install it by typing: sudo apt-get install gnome-documents 

But, in this case, I should at least know the program name

Источник

Читайте также:  Software version command linux

Search for a Debian Package

To search for an installed package including the file «toto»:

To search for the package «toto»:

It is often preferable to generalize, and search for all packages with «toto» in their name:

This program does, more or less, the same thing as dpkg, but it does it even quicker. For more information, see man dlocate

Find an official package (installed or not)

1. Use apt-cache (available since Debian 2.2)

apt-cache allows searching rapidly among the entire list of available Debian packages. The most current usage is to use the «search» option with a rational expression as a parameter.

This will post the names of all packages containing the expression «emacs» in the name or description. If you wish to search only for those packages with the search expression in the name, add the option —names-only:

apt-cache search --names-only emacs

To learn more about a listed package use:

apt-cache show packagename

This will provide a more complete description of the package named «packagename». Clearly, if you wanted to see such information for, say, emacs, you would use:

Another option is to use aptitude search.

This will basically provide the same information as apt-cache search.

Connect to the irc server at irc.debian.org, join channel #debian (or the alternative secondary channel on irc.libera.chat), then: (with «toto» as the name of the package or file):

% /msg dpkg !find toto toto is in package: bla. bla

To search for a package in a specific distribution, such as the current Stable, named «squeeze», try

% /msg dpkg !find toto squeeze

3. Search the Debian website

Читайте также:  Get to linux desktop

The Debian site has had a built in search engine for some time.

A package that has been removed from Debian

For various reasons, a package may be removed from Debian and no longer be easily accessible. In this case, try here: http://snapshot.debian.org

This site covers all Debian packages, including those which have been removed from Debian due to excessive bugs, security problems, etc. It does not, however, retain packages that have been removed for licensing issues.

An unofficial package

For various reasons, it may be useful (or necessary) to install «unofficial» Debian packages, not provided in the official Debian sources. There a a myriad of unofficial sources, each meeting a particular need (specifically configured or recompiled applications, for instance).

We have a site to identify and evaluate the quality of «unofficial» sources.

Site for finding unofficial sources: http://www.apt-get.org unavailable

Any random package?

What follows are two rather general methods for finding packages. The first is use to search for a package (or it could be used to find a config file, easily enough), and the second is used to find a file.

1. Run grep on the apt-get files. This works for all packages that you can install with

meaning, those available in the repositories listed in your /etc/apt/sources.list

These files are available in /var/lib/apt/lists

To be certain that this list is current, you first may want to run

Example : Search for the cddb package:

awk -v RS='' '/^Package: cddb/ < print $0 "\n"; >' /var/lib/apt/lists/*Packages || pager
Package: cddb Priority: optional Section: sound Installed-Size: 86 Maintainer: Adrian Bridgett Architecture: i386 Source: xmcd Version: 2.6-10 Replaces: xmcd ( Depends: libc6 (>= 2.2.3-7) Conflicts: suidmanager ( Filename: pool/main/x/xmcd/cddb_2.6-10_i386.deb
% /mnt/cdrom/dists/stable/Contents-i386.gz

Источник

Оцените статью
Adblock
detector