Linux find installed apps

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.

Читайте также:  Манжара линукс как установить

Источник

How to find manually installed program in Linux Mint

Yesterday I installed Android Studio. I didn’t install via the package manager or Software Center. Instead, I downloaded the ZIP package and installed it. After the installation, Android Studio worked fine, although now I can’t find it. It’s not in my Applications List. How can I find it?

3 Answers 3

You could try sudo find / -name «studio.*» .

The way this command works is simple:

  • sudo runs the find command as superuser (supersuser do) so you can check all the directories in the file system including the locked ones.
  • find searches a given location ( / in our case) for a given file or directory.
  • / is the parameter that dictates find where to search (in the whole file system).
  • studio.* is what to search for . the wildcard at the end specifies to search for all files that begin with studio. . If you wish to make sure you have all possibilities covered, you could run sudo find / -name «*studio*» .

If you know part of the name of a file you installed, e.g. studio , you can run

The locate command finds files whose name contains the specified string. It uses an index which is updated every night (in a typical configuration; the index is updated by a cron job that calls updatedb with appropriate parameters), so you won’t be able to locate files installed today this way, unless you update the index manually.

Источник

How can i find the location of installed software in linux?

Is there any command that I can use in the console to know the location of installed software in linux? i have copied a xyz.bin from windows machine to linuxdesktop and installed it. more over can you please tell me how to uninstall a software which is installed in linux Thanks in advance

You might be able to use the find command to search for it. Have a look at this unix.stackexchange.com/questions/19369/…

3 Answers 3

to find the path where the binary is linked to.

Other application specific files may reside in

The way a package is installed/uninstalled on Linux depends on either the specific Linux distribution AND the specific package.

Читайте также:  Установка virtualbox linux fedora

Since you have used a .bin file for installation, it is likely that you have an uninstall command specific for your program in the path.

If you provide more information about the package and the Linux distribution, we can give more help.

It depends on the distribution you’re using. Supposing you are using a debian\ubuntu distribution, you can uninstall it by the apt command, using sudo apt-get remove software_name sudo apt-get purge software_name

Of course you need to have root privileges.

The softwares are usually installed in bin folders, in /usr/bin, /home/user/bin and many other places, a nice starting point could be the find command to find the executable name, but it’s usually not a single folder. The software could have components and dependencies in lib,bin and other folders.

Источник

How do I find where an application is installed?

I installed wireshark recently. I have no idea in which directory it was installed, but it’s not in /opt . How do I find where it’s installed?

5 Answers 5

Assuming you installed it from the repos:

$ dpkg -L wireshark wireshark-common /. /usr /usr/bin /usr/bin/wireshark /usr/share /usr/share/menu /usr/share/menu/wireshark /usr/share/pixmaps /usr/share/pixmaps/wsicon32.xpm /usr/share/applications /usr/share/applications/wireshark.desktop /usr/share/doc /usr/share/doc/wireshark /usr/share/doc/wireshark/copyright /usr/share/icons /usr/share/icons/hicolor /usr/share/icons/hicolor/48x48 /usr/share/icons/hicolor/48x48/apps /usr/share/icons/hicolor/48x48/apps/wireshark.png /usr/share/icons/hicolor/scalable /usr/share/icons/hicolor/scalable/apps /usr/share/icons/hicolor/scalable/apps/wireshark.svg /usr/share/man /usr/share/man/man1 /usr/share/man/man1/wireshark.1.gz /usr/share/doc/wireshark/changelog.Debian.gz /usr/share/doc/wireshark/README.Debian /. /usr /usr/bin /usr/bin/editcap /usr/bin/text2pcap /usr/bin/dumpcap /usr/bin/rawshark /usr/bin/mergecap /usr/bin/capinfos /usr/share /usr/share/doc /usr/share/doc/wireshark-common /usr/share/doc/wireshark-common/README.Debian /usr/share/doc/wireshark-common/copyright /usr/share/lintian /usr/share/lintian/overrides /usr/share/lintian/overrides/wireshark-common /usr/share/man /usr/share/man/man4 /usr/share/man/man4/wireshark-filter.4.gz /usr/share/man/man1 /usr/share/man/man1/mergecap.1.gz /usr/share/man/man1/capinfos.1.gz /usr/share/man/man1/dumpcap.1.gz /usr/share/man/man1/editcap.1.gz /usr/share/man/man1/text2pcap.1.gz /usr/share/man/man1/rawshark.1.gz /usr/share/doc/wireshark-common/changelog.Debian.gz 

which wireshark will lead you to the executable. The output could ressemble this :

$ which wireshark /usr/bin/wireshark 

Software never gets installed into /opt unless you yourself do that.

it only works in this particular case. what if I was to install «my super program», how would I find its path?

@AlanDert why would it not work? 🙂 which checks the current environment so it will find it if you can execute it.

Some packages do install in /opt , though none in the main repositories do this. Examples: Google Chrome, Adobe Reader (Canonical partner repository), Spotify, etc. Please also note that it is even an requirement to install in /opt for MyApps (extras.ubuntu.com). developer.ubuntu.com/publish/my-apps-packages

Читайте также:  Установка curl astra linux

This answer is mostly wrong. which program-name returns the path to the executable, which can be completely different from the install location of a program(e.g. there is /usr/bin/inkscape but the installation is in /usr/share/inkscape ). They are identical iff the program is a single executable without any need for system-wide resources/extensions/configurations.

I would recommend going with @Oli’s answer, if that works for you. For applications that you (for whatever reason) didn’t install with the

You can examine the unity launcher icon, it may be able to tell you:

The launcher file will usually be located in /usr/share/applications/ , and named something like my-application-launcher.desktop . If you don’t know exactly what the file is called, use ls to examine the directory. (For your specific one, it is called wireshark.desktop .)

Once you know which one it is, examine its contents (anything from cat to gedit will work, but if you use gedit make sure to do it as gksu gksu gedit , not sudo gedit ).

The file will contain an entry with something like Exec=command or Exec=/path/to/script.sh . If it only has a command, you can use which or locate (like @Rinzwind said) to get the full path for it. Another option is to use whereis to find the binary or source location.

The directory containing the launcher’s target should be the installation directory for the program. If the launcher points to a shell script, sometimes examining its contents can reveal additional locations, if needed.

Running gksu nautilus when you get there will give you a windowed file browser with root permissions, meaning you can use it to copy/delete/edit any file, since normally installations are protected and will prevent you from modifying files as a normal user.

If that doesn’t work, another option is to use find , to find anything with the same name, or grep , to find files containing the name.

However, you should only do this if you don’t have any better alternatives. This can be a slow, tedious, mind-numbing process, especially since sometimes there is more than one location that stuff is installed to. If you can, use some other method.

Источник

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