How to check what has been installed in addition to the main application

How to check what packages were added (installed) during the installation of an application. For example, I have been installing MPV applications recently and I want to know what was installed in addition to the MPV itself. With neofetch I see that there are more by 60 packages.

And how to return to the state before installation? I tried the command -Rncs mpv but I get a message that I can not do. I would like to see how to return to exactly the same state as before installing the MPV add-ons (I had probably 805 packages at the time)

Looks like the Arch wiki is your friend.

I did not know about this command, but could be this one as described in the wiki, under quering database packages

To retrieve a list of the files installed by a package:

$ pacman -Ql package_name
1 Like

I would use the following, same Arch wiki page.

To remove a package and its dependencies which are not required by any other installed package:

$ pacman -Rs package_name
1 Like

It’s not easy to know exactly, because some of the dependencies used by mpv could be installed as dependencies for some other package.

You can see mpv dependencies with :

yay -Qi mpv or pacman -Qi mpv
Depends On      : alsa-lib  desktop-file-utils  ffmpeg
                  hicolor-icon-theme  jack  lcms2  libarchive
          libass  libbluray
                  libcdio  libcdio-paranoia  libdrm  libdvdnav  libdvdread  libegl  libgl
                  libglvnd  libjpeg  libplacebo  libpulse
          libvdpau  libx11  libxext  libxinerama  libxkbcommon
          libxrandr  libxss  libxv  luajit  mesa  mujs  rubberband
          shaderc  uchardet
                  vulkan-icd-loader  wayland  xdg-utils  zlib

For example, hicolor-icon-theme is required by Xfce, ffmpeg by Firefox, mesa is installed by default for the hardware acceleration of your GPU.

The options used with pacman can be used with yay :

1 Like

Wondering if the first command I posted above would list only the packages installed by the program, meaning that if some packages were already on the system it would not add them to the list.

Second command

sudo pacman -Rs

Should take care of it, won’t delete depencies needed by other packages.

For example, command

pactree -d1 "application-name"

should show direct dependencies.

But it is not easy to know, unless you note it somewhere or you search in the journal, how the packages were installed chronologically and which one were installed first as dependencies of others.

You could use pacseek. It will show you everything that is installed or you can look up a particular package and it will tell you it’s dependencies. If pacseek isn’t installed you have to install it.

1 Like