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.
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
Список установленных программ в Ubuntu
Многих новых пользователей Linux интересует, как посмотреть список установленных программ в Ubuntu. Не важно зачем: может вам нужно удалить ту или иную программу, или просто посмотреть, сколько программ в системе установлено. Или же вам необходимо экспортировать список всех программ, чтобы потом быстро установить их в другой системе. Сделать это можно несколькими способами.
Начнём с более простого способа - с помощью главного меню. Откройте меню, затем перейдите в категорию Приложения, в разделе все вы можете увидеть ярлыки установленных программ:
Правда программы здесь далеко не все, а только те, для которых есть ярлыки и которые можно запустить в графическом интерфейсе.
Второй способ — с помощью центра приложений. Откройте менеджер приложений, щелкнув по его значку на боковой панели:
Выберите вкладку Установлено:
И снова здесь не все приложения, а только установленные через центр приложений или snap-пакеты. Каждую программу можно удалить или посмотреть дополнительную информацию:
Способ третий — более сложный и потребует установки дополнительного программного обеспечения — менеджера пакетов. Запустите терминал (Ctrl + Alt + T) и наберите:
sudo apt install synaptic
Установка пакетов — действие от суперпользователя, поэтому система спросит пароль. Когда процесс закончится, найдите программу в главном меню и откройте её. Затем перейдите в Состояния → Установленные:
В списке будут отображены все пакеты, установленные через пакетный менеджер apt, в том числе библиотеки и сервисы. Но тут нет пакетов, установленных через snap. Здесь также можно удалять и устанавливать приложения. Сначала их надо выбрать, а потом нажать кнопку Применить.
Способ четвёртый — с помощью консольной утилиты dpkg. Будет выведена аналогичная информация, что и в synaptic, только в терминале. Откройте терминал и наберите:
Утилита выведет список всех установленных пакетов с указанием версии, архитектуры и краткого описания:
Чтобы посмотреть список пакетов Ubuntu, установленных через пакетный менеджер snap, используйте такую команду в терминале:
Как видите, посмотреть список абсолютно всех программ в одном месте нельзя. Самый полный список показывают утилиты dpkg и synaptic. Есть и другие способы, но этого, я думаю, будет вполне достаточно. Удачи вам в экспериментах, и не удалите ничего нужного!
Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.
How do I list all installed programs?
Hm, I'm interested in Red Hat, Ubuntu, and cygwin. Is there a distribution-free way to list the programs with some command line argument?
4 Answers 4
That depends on your distribution.
- Aptitude-based distributions (Ubuntu, Debian, etc): dpkg -l
- RPM-based distributions (Fedora, RHEL, etc): rpm -qa
- pkg*-based distributions (OpenBSD, FreeBSD, etc): pkg_info
- Portage-based distributions (Gentoo, etc): equery list or eix -I
- pacman-based distributions (Arch Linux, etc): pacman -Q
- Cygwin: cygcheck --check-setup --dump-only *
- Slackware: slapt-get --installed
All of these will list the packages rather than the programs however. If you truly want to list the programs, you probably want to list the executables in your $PATH , which can be done like so using bash's compgen :
Or, if you don't have compgen :
#!/bin/bash IFS=: read -ra dirs_in_path "; do for file in "$dir"/*; do [[ -x $file && -f $file ]] && printf '%s\n' "$" done done
It would be better to distinguish between package managers instead of "distributions". NetBSD's pkgsrc runs on any Linux, and some package managers can be used on multiple Uinces.
Answering the second part of the question (nothing really to be added to Chris' answer for the first part):
There is generally no way of listing manually installed programs and their components. This is not recorded anywhere if you didn't use a package manager. All you can do is find the binaries in standard locations (like Chris suggested) and in a similar way, guess where some libraries or some manual pages etc. came from. That is why, whenever possible, you should always install programs using your package manager.
Programs should be reachable via the PATH, so just list everything in the path:
Expect a result of about 3k-4k programs.
To exclude a probable minority of false positives, you may refine the approach:
for d in $ ; do for f in $d/* ; do test -x $f && test -f $f && echo $f done done
It didn't make a difference for me.