Find installed programs on linux

How can I find and run an application that’s already installed?

I see that apturl is installed on my computer, but I can’t seem to locate it. Can anybody tell me how I can find an installed application on this computer? I am getting very frustrated.

I believe apturl is a command-line program. Find out more by reading the manual page from the terminal: man apturl

3 Answers 3

Not all programs are graphical, and thus they will not be in your menu.

You can locate them with several commands

which apturl locate apturl 

locate uses a database that is automatically updated every 24 hours. To manually update,

If your command is not on your path, use find

Learning to use programs on the command line takes a little time. IMO it is invaluable to learn to read the man pages. They seem like Greek at first, but in time they are invaluable.

You can also try -h or —help

To find out where a program is installed use the whereis command in an open terminal like this:

the output should look like this:

apturl: /usr/bin/apturl /usr/bin/X11/apturl /usr/share/apturl /usr/share/man/man8/apturl.8.gz 

When an app is in the bin or sbin folders it can be started in a terminal by using the name of the file stored in bin or sbin like this

For more info on how to use this command I have taken the following from http://manpages.ubuntu.com/manpages/precise/man8/apturl.8.html

you can access this by typing the following in a terminal:

 apturl just needs an URL conforming with the apt-protocol in order to work. Additionally, it recognizes the following options: -p, --http-proxy Use the given HTTP proxy in order to download the packages. 
 apturl apt:pidgin,pidgin-plugin-pack Installs Pidgin and Pidgin Plugin Pack (if the user confirms). apturl apt:freevial?section=universe Enables the "universe" component and installs package Freevial. apturl apt:adobe-flashplugin?channel=lucid-partner Enables the "partner" repository and installs package adobe- flashplugin. Available repositories are listed in /usr/share/app-install/channels/. apturl apt+http://launchpad.net/~mvo/ppa?package=2vcard Installs 2vcard from the indicated PPA (if the user confirms), and afterwards asks if the PPA should be removed again or it should remain enabled. Warning: This is currently disabled because of security concerns. 

Источник

How can I list all applications installed in my system?

is also not an option because it shows all installed packages and it contains drivers, kernels and libraries.

6 Answers 6

I came up with this answer for people who wants to use bash in a good way. It’s clear that the answer of the question is related to the listing of the files from /usr/share/applications , but the problem is that ls command shouldn’t be parsed ever. In the past, I was doing the same mistake, but now I learned that the best way is to use a for loop to iterate over the files, even if I must use some more keys from my precious keyboard:

for app in /usr/share/applications/*.desktop; do echo "$"; done 

I also used in the previous command string manipulation operations: removed from app first 24 characters which are /usr/share/applications/ and last 8 characters which are .desktop .

Читайте также:  Линукс убунту удаленный доступ

Another place where you can find applications shown by the Dash is ~/.local/share/applications/*.desktop . So you need to run the following command as well:

for app in ~/.local/share/applications/*.desktop; do echo "$"; done 

To unify the previous two commands, you can use:

for app in /usr/share/applications/*.desktop ~/.local/share/applications/*.desktop; do app="$"; echo "$"; done 

To get the list of all your installed applications with their names, the easiest way is to do:

sudo apt-get install aptitude aptitude -F' * %p -> %d ' --no-gui --disable-columns search '?and(~i. section(libs), !?section(kernel), !?section(devel))' 

It will get you a nice list of all installed packages that are not libraries, not kernels, not development package like this:

* zip -> Archiver for .zip files * zlib1g -> compression library - runtime * zlib1g-dev -> compression library - development * zsh -> shell with lots of features * zsh-common -> architecture independent files for Zsh 

It’s more complete since it also lists non-GUI applications that won’t appear in the .desktop files

I can not agree with this answer to this question. The answer is nice, but not in this place. Is clear enough that the OP wants a list with applications which can be found in the Dash. And there is not place for zsh , zsh-common and others!

@RaduRădeanu I just used tail to show an excerpt of my installed packages, which ends with z, if I had used head, they will start with a, 2) he wants applications listed in the «dash»? Are you sure?

Braiam, came on, it is not about which start with z or with a. When you hit Super+A on your keyboard what can you see appearing on your screen starting from the top-left corner?

@RaduRădeanu OP’s title says that he wants to list all applications installed in his system excluding libraries, drivers, kernels and others.. He mentions one of the way (which he uses) to get the app-list, which is using Super + A and that just displays a subset of the applications installed in the system; but this covers most if not all.. the answer would be even complete with —no-gui removed.

Run the below command to see all the installed applications,

ls /usr/share/applications | awk -F '.desktop' ' < print $1>' - 

If you want to get the list of all installed applications, then run the below command,

ls /usr/share/applications | awk -F '.desktop' ' < print $1>' - > ~/Desktop/applications.txt 

It will stores the above command output to applications.txt file inside your ~/Desktop directory.

OR

Also run the below command on terminal to list the installed applications,

find /usr/share/applications -maxdepth 1 -type f -exec basename <> .desktop \; | sort 

To get the list in text file, run the below command

find /usr/share/applications -maxdepth 1 -type f -exec basename <> .desktop \; | sort > ~/Desktop/applications.txt 

Desktop entries for all the installed applications are stored inside /usr/share/applications directory, where file names are in the format of application-name.desktop .Removing the .desktop part from the file names will give you the total list of installed applications.

Читайте также:  Command option argument linux

As @Radu suggested, you can also find desktop entries for your additional installed applications inside ~/.local/share/applications directory.

find /usr/share/applications ~/.local/share/applications -maxdepth 1 -type f -exec basename <> .desktop \; 

Thanks Radu however how many times have you seen a filename containing a newline? Never? Thought so . So I should never ever use something very useful because of an edge case that virtually never happens? I think I’ll keep parsing ls — for representational purposes and for non-critical tasks such as the one above — and try to keep in mind this limitation, thank you for the heads up!

Not sure why most of the answers posted involves extracting the filename of .desktop shortcuts. Your .desktop shortcut filename can be anything but what matters is the Name field inside the shortcut file. If you want to build the list of installed application names showing in Dash, just «grep» that field under [Desktop Entry]

Rudimental code, with bash

#!/bin/bash for file in /usr/share/applications/*.desktop; do while IFS== read -r key val do if [[ -z $key ]]; then continue else if [[ $key =~ ^\[Desktop\ Entry ]]; then interesting_field=1 elif [[ $key =~ ^\[ ]]; then interesting_field=0 fi fi [[ $interesting_field -eq 1 ]] && [[ $key == "Name" ]] && echo $val done < $file done 

But this does not take into account shortcuts that are hidden from being showed in Dash. Someone with better understand of .desktop spec might want to further expand this code to exclude those kinda of shortcuts

Edit : another attempt, with Python

#!/usr/bin/python from os import listdir from os.path import isfile, join import ConfigParser SHORTCUTDIR = "/usr/share/applications/" shortcuts = [ file for file in listdir(SHORTCUTDIR) if isfile(join(SHORTCUTDIR, file)) and file.endswith(".desktop") ] dash_shortcuts = [] for f in shortcuts: c = ConfigParser.SafeConfigParser() c.read(SHORTCUTDIR + f) try: if c.getboolean('Desktop Entry', 'NoDisplay') is True: continue except ConfigParser.NoOptionError: pass try: if "unity" in c.get('Desktop Entry', 'NotShowIn').lower(): continue except ConfigParser.NoOptionError: pass try: if "unity" not in c.get('Desktop Entry', 'OnlyShowIn').lower(): continue except ConfigParser.NoOptionError: pass dash_shortcuts += [ c.get("Desktop Entry", "Name") ] for s in sorted(dash_shortcuts, key=str.lower): print s 

Источник

Where can I find the location of folders for installed programs?

I'm new to Ubuntu and would like to know where I can find the location of program files for programs installed from the Ubuntu Software Center or the Terminal.

If you prefer/use RPM on Ubuntu, you can also use rpm –ql [package] to get a list. This method also happens to work on most Fedora and RHEL distros.

8 Answers 8

Also, if you just need to know where the executable is you can run whereis executable or which executable For instance:

$ whereis firefox firefox: /usr/bin/firefox /etc/firefox /usr/lib/firefox /usr/share/man/man1/firefox.1.gz $ which firefox /usr/bin/firefox 

on the command line, you can use dpkg --listfiles packagename . For instance, dpkg --listfiles firefox . If you want to see what files a package contains without installing it, then you can install apt-file and use that.

But you really shouldn't mess with it. There is usually no reason to manually interfere with the contents of a package. All configuration files for normal applications are placed in the users home directory. You don't have savegames in C:\Programfiles\Appname\savegames , for instance. They would be placed in /home/username/.local/share/appname/savegames . That way, if you move your home directory to another machine, it keeps all configurations and user data.

Читайте также:  Захват pmkid kali linux

This command says "package 'sdl' is not installed"; But this command: "dpkg --get-selections | grep sdl" returned : libsdl-image1.2:amd64 install ---- libsdl1.2debian:amd64 install ---- libsdl2-2.0-0:amd64 install ---- libsdl2-dev install

The OP wants to know where the installation directory containing the app files is located. He did not ask for a list of files in a package.

@HedleyFinger: There is no such thing as the "installation directory". Each app has files stored in many different directories for different types of files. /etc for default configs, /usr/bin for binaries, /usr/lib for libraries, etc. The command I showed, shows where all app files are installed.

If you do not find the command with whereis or which then maybe it is an alias. Try

and check if the command is in the list.

Use the synaptic-package-manager :

synaptic Package Manager (GUI)

Assuming that we'd like to locate the files of the autotools-dev package, under 'Quick filter' enter autotools to locate it. The autotools-dev package appears automatically. Select it by clicking on it and then press 'Properties'. In the appearing dialog select the tab 'Installed Files'.

The builtin Bash command, called command is also available:

 command [-pVv] command [arguments …] 
$ command -V cat cat is /bin/cat 

When the searched command is an alias:

$ command -v ll alias ll='ls -alF' 
$ command -V ll ll is aliased to `ls -alF' 

Coming to Linux from Windows, there are some different terminology, which sometimes seems strange.

The first one is the word package that we find on Linux. We install packages on Linux, which may sound different but makes total sense:

  • When installing something on the computer, we are installing programs like in your question, but also configuration files, images, documentation, etc. Sometimes we are even installing, in one package, many programs

One example for you, i was looking for installing a package called bluez-tools in Lubuntu 22.04. In your terminal:

sudo apt install bluez-tools 

After installing it, the question is, how to use this bluez-tools stuff i have installed. Then we have the answer to your question, we have to look for what and where we have just installed the package in our system.

The following command gives you some information about the package you just installed.

dpkg -l bluez-tools ii bluez-tools 2.0~20170911.0.7cb788c-4 amd64 Set of tools to manage Bluetooth devices for linux 

And this other command shows what and where things were installed

dpkg -l bluez-tools /. /usr/bin /usr/bin/bt-adapter /usr/bin/bt-agent /usr/bin/bt-device /usr/bin/bt-network /usr/bin/bt-obex /usr/share /usr/share/doc /usr/share/doc/bluez-tools /usr/share/doc/bluez-tools/README /usr/share/doc/bluez-tools/changelog.Debian.gz /usr/share/doc/bluez-tools/copyright /usr/share/man /usr/share/man/man1 /usr/share/man/man1/bt-adapter.1.gz /usr/share/man/man1/bt-agent.1.gz /usr/share/man/man1/bt-device.1.gz /usr/share/man/man1/bt-network.1.gz /usr/share/man/man1/bt-obex.1.gz 

It can be seen the package contains 5 programs, some docs, and five manual pages.

Источник

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