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.

https://wiki.archlinux.org/title/pacman#Querying_package_databases

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  libasound.so=2-64  desktop-file-utils  ffmpeg  libavcodec.so=59-64
                  libavdevice.so=59-64  libavfilter.so=8-64  libavformat.so=59-64
                  libavutil.so=57-64  libswresample.so=4-64  libswscale.so=6-64  glibc
                  hicolor-icon-theme  jack  libjack.so=0-64  lcms2  liblcms2.so=2-64  libarchive
                  libarchive.so=13-64  libass  libass.so=9-64  libbluray  libbluray.so=2-64
                  libcdio  libcdio-paranoia  libdrm  libdvdnav  libdvdread  libegl  libgl
                  libglvnd  libjpeg  libjpeg.so=8-64  libplacebo  libplacebo.so=208-64  libpulse
                  libpulse.so=0-64  libva  libva.so=2-64  libva-drm.so=2-64  libva-wayland.so=2-64
                  libva-x11.so=2-64  libvdpau  libx11  libxext  libxinerama  libxkbcommon
                  libxkbcommon.so=0-64  libxrandr  libxss  libxv  luajit  mesa  mujs  rubberband
                  librubberband.so=2-64  shaderc  libshaderc_shared.so=1-64  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 :
https://wiki.archlinux.org/title/pacman
or
https://wiki.archlinux.org/title/Pacman/Rosetta

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