LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Help on uninstalling a program and dependency tree (https://www.linuxquestions.org/questions/linux-from-scratch-13/help-on-uninstalling-a-program-and-dependency-tree-4175617597/)

hariskar 11-14-2017 04:37 AM

Help on uninstalling a program and dependency tree
 
Is there a way to find which dependencies of the whole dependency tree is not needed from other programs so as to uninstall them? Eg if I want to uninstall webkit-gtk or chromium I should also uninstall the dependencies (some of them go 3-4 levels deep). How could I know which ones are not used by other programs?

Thank you!

Keith Hedger 11-14-2017 06:24 AM

1)
Keep a track of what you are installing to start of with.
2)
You can see all the linked libs for and application like so
Code:

ldd /usr/lib64/libwebkitgtk-1.0.so
        linux-vdso.so.1 (0x00007ffe13330000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fa531fff000)
        libjavascriptcoregtk-1.0.so.0 => /usr/lib64/libjavascriptcoregtk-1.0.so.0 (0x00007fa53173c000)
        libharfbuzz-icu.so.0 => /usr/lib64/libharfbuzz-icu.so.0 (0x00007fa531539000)
        libharfbuzz.so.0 => /usr/lib64/libharfbuzz.so.0 (0x00007fa5312a7000)
        libgmodule-2.0.so.0 => /usr/lib64/libgmodule-2.0.so.0 (0x00007fa5310a3000)
        libgthread-2.0.so.0 => /usr/lib64/libgthread-2.0.so.0 (0x00007fa530e9f000)
        libgstapp-1.0.so.0 => /usr/lib64/libgstapp-1.0.so.0 (0x00007fa530c91000)
        libgstaudio-1.0.so.0 => /usr/lib64/libgstaudio-1.0.so.0 (0x00007fa530a2c000)
        libgstfft-1.0.so.0 => /usr/lib64/libgstfft-1.0.so.0 (0x00007fa530821000)
        libgstpbutils-1.0.so.0 => /usr/lib64/libgstpbutils-1.0.so.0 (0x00007fa5305ec000)
        libgstvideo-1.0.so.0 => /usr/lib64/libgstvideo-1.0.so.0 (0x00007fa530375000)
        libgstbase-1.0.so.0 => /usr/lib64/libgstbase-1.0.so.0 (0x00007fa53010f000)
        libgstreamer-1.0.so.0 => /usr/lib64/libgstreamer-1.0.so.0 (0x00007fa52fddf000)
        libgtk-x11-2.0.so.0 => /usr/lib64/libgtk-x11-2.0.so.0 (0x00007fa52f7a5000)
        libgdk-x11-2.0.so.0 => /usr/lib64/libgdk-x11-2.0.so.0 (0x00007fa52f4f4000)
        libpangocairo-1.0.so.0 => /usr/lib64/libpangocairo-1.0.so.0 (0x00007fa52f2e8000)
        libatk-1.0.so.0 => /usr/lib64/libatk-1.0.so.0 (0x00007fa52f0c2000)
        libcairo.so.2 => /usr/lib64/libcairo.so.2 (0x00007fa52edaa000)
        libgdk_pixbuf-2.0.so.0 => /usr/lib64/libgdk_pixbuf-2.0.so.0 (0x00007fa52eb87000)
        libjpeg.so.8 => /usr/lib64/libjpeg.so.8 (0x00007fa52e91d000)
        libsecret-1.so.0 => /usr/lib64/libsecret-1.so.0 (0x00007fa52e6d3000)
        libsoup-2.4.so.1 => /usr/lib64/libsoup-2.4.so.1 (0x00007fa52e3f1000)
        libgio-2.0.so.0 => /usr/lib64/libgio-2.0.so.0 (0x00007fa52e061000)
        libxslt.so.1 => /usr/lib64/libxslt.so.1 (0x00007fa52de1f000)
        liblzma.so.5 => /lib/liblzma.so.5 (0x00007fa52dbf9000)
        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fa52d894000)
        libGL.so.1 => /usr/lib64/libGL.so.1 (0x00007fa52d62b000)
        libEGL.so.1 => /usr/lib64/libEGL.so.1 (0x00007fa52d3fe000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007fa52d1fa000)
        libpangoft2-1.0.so.0 => /usr/lib64/libpangoft2-1.0.so.0 (0x00007fa52cfe4000)
        libpango-1.0.so.0 => /usr/lib64/libpango-1.0.so.0 (0x00007fa52cda1000)
        libgobject-2.0.so.0 => /usr/lib64/libgobject-2.0.so.0 (0x00007fa52cb4f000)
        libglib-2.0.so.0 => /usr/lib64/libglib-2.0.so.0 (0x00007fa52c83e000)
        libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x00007fa52c5fb000)
        libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x00007fa52c34c000)
        libpng16.so.16 => /usr/lib64/libpng16.so.16 (0x00007fa52c115000)
        libsqlite3.so.0 => /usr/lib64/libsqlite3.so.0 (0x00007fa52be41000)
        libicui18n.so.58 => /usr/lib64/libicui18n.so.58 (0x00007fa52b9d1000)
        libicuuc.so.58 => /usr/lib64/libicuuc.so.58 (0x00007fa52b62a000)
        libicudata.so.58 => /usr/lib64/libicudata.so.58 (0x00007fa529b2a000)
        libwebp.so.7 => /usr/lib64/libwebp.so.7 (0x00007fa5298c4000)
        libXcomposite.so.1 => /usr/lib64/libXcomposite.so.1 (0x00007fa5296bf000)
        libXdamage.so.1 => /usr/lib64/libXdamage.so.1 (0x00007fa5294bc000)
        libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x00007fa5292b6000)
        libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x00007fa5290ac000)
        libXt.so.6 => /usr/lib64/libXt.so.6 (0x00007fa528e45000)
        libX11.so.6 => /usr/lib64/libX11.so.6 (0x00007fa528b0a000)
        libz.so.1 => /lib/libz.so.1 (0x00007fa5288f1000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fa528571000)
        libm.so.6 => /lib/libm.so.6 (0x00007fa52825e000)
        libc.so.6 => /lib/libc.so.6 (0x00007fa527eba000)
        /lib64/ld-linux-x86-64.so.2 (0x000055576195f000)
        libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007fa527ca3000)
        libpcre.so.1 => /lib/libpcre.so.1 (0x00007fa527a5f000)
        libgsttag-1.0.so.0 => /usr/lib64/libgsttag-1.0.so.0 (0x00007fa527824000)
        librt.so.1 => /lib/librt.so.1 (0x00007fa52761c000)
        libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x00007fa527419000)
        libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x00007fa52720e000)
        libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x00007fa527003000)
        libXext.so.6 => /usr/lib64/libXext.so.6 (0x00007fa526def000)
        libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x00007fa526bca000)
        libpixman-1.so.0 => /usr/lib64/libpixman-1.so.0 (0x00007fa526925000)
        libxcb-shm.so.0 => /usr/lib64/libxcb-shm.so.0 (0x00007fa526722000)
        libX11-xcb.so.1 => /usr/lib64/libX11-xcb.so.1 (0x00007fa526520000)
        libxcb-render.so.0 => /usr/lib64/libxcb-render.so.0 (0x00007fa526311000)
        libffi.so.6 => /usr/lib64/libffi.so.6 (0x00007fa526109000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00007fa525ef3000)
        libmount.so.1 => /lib/libmount.so.1 (0x00007fa525ca8000)
        libexpat.so.1 => /usr/lib64/libexpat.so.1 (0x00007fa525a7e000)
        libxcb-dri3.so.0 => /usr/lib64/libxcb-dri3.so.0 (0x00007fa525879000)
        libxcb-present.so.0 => /usr/lib64/libxcb-present.so.0 (0x00007fa525676000)
        libxcb-sync.so.1 => /usr/lib64/libxcb-sync.so.1 (0x00007fa525470000)
        libxshmfence.so.1 => /usr/lib64/libxshmfence.so.1 (0x00007fa52526e000)
        libglapi.so.0 => /usr/lib64/libglapi.so.0 (0x00007fa52503f000)
        libxcb-glx.so.0 => /usr/lib64/libxcb-glx.so.0 (0x00007fa524e26000)
        libxcb-dri2.so.0 => /usr/lib64/libxcb-dri2.so.0 (0x00007fa524c1f000)
        libXxf86vm.so.1 => /usr/lib64/libXxf86vm.so.1 (0x00007fa524a19000)
        libdrm.so.2 => /usr/lib64/libdrm.so.2 (0x00007fa524809000)
        libxcb-xfixes.so.0 => /usr/lib64/libxcb-xfixes.so.0 (0x00007fa524602000)
        libgbm.so.1 => /usr/lib64/libgbm.so.1 (0x00007fa5243f6000)
        libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007fa5241e4000)
        libSM.so.6 => /usr/lib64/libSM.so.6 (0x00007fa523fdc000)
        libuuid.so.1 => /lib/libuuid.so.1 (0x00007fa523dd7000)
        libICE.so.6 => /usr/lib64/libICE.so.6 (0x00007fa523bbb000)
        libXau.so.6 => /usr/lib64/libXau.so.6 (0x00007fa5239b5000)
        libXdmcp.so.6 => /usr/lib64/libXdmcp.so.6 (0x00007fa5237af000)
        libblkid.so.1 => /lib/libblkid.so.1 (0x00007fa52356c000)

3)
Use a package manager of some sort, for instance I use my own and can get a dependency list like so
Code:

keithhedger@LFSDev:~-> lfspkg -F webkitgtk-2
Locating scripts -
Found dependency PCRE-8.40
Found dependency libffi-3.2.1
Found dependency expat-2.2.0
Found dependency pkg-config-0.29.1
Found dependency Python-2.7.13
Found dependency libxml2-2.9.4
Found dependency UnZip-6.0
Found dependency docbook-xml-4.5
Found dependency docbook-xsl-1.79.1
Found dependency Itstool-2.0.2
Found dependency libxslt-1.1.29
Found dependency xmlto-0.0.28
Found dependency GTK-Doc-1.25
Found dependency GLib-2.50.3
Found dependency gobject-introspection-1.50.0
Found dependency GStreamer1.0-1.10.3
Found dependency gst-plugins-base1.0-1.10.3
Found dependency ATK-2.22.0
Found dependency Cython-0.23.4
Found dependency yasm-1.3.0
Found dependency libjpeg-turbo-1.5.1
Found dependency libpng-1.6.28
Found dependency LibTIFF-4.0.7
Found dependency gdk-pixbuf-2.36.5
Found dependency Pixman-0.34.0
Found dependency Cairo-1.14.8
Found dependency icu-58.2
Found dependency Which-2.21
Found dependency FreeType-2.7.1
Found dependency Harfbuzz-1.4.2
Found dependency Fontconfig-2.12.1
Found dependency util-macros-1.19.1
Found dependency proto-8.0
Found dependency libXau-1.0.8
Found dependency xcb-proto-1.12
Found dependency libxcb-1.12
Found dependency xorg-libs-8.0
Found dependency Pango-1.40.3
Found dependency hicolor-icon-theme-0.15
Found dependency GTK-2.24.31
Found dependency libunistring-0.9.7
Found dependency Nettle-3.3
Found dependency GnuTLS-3.5.9
Found dependency Intltool-0.51.0
Found dependency gsettings-desktop-schemas-3.22.0
Found dependency glib-networking-2.50.0
Found dependency SQLite-3.17.0
Found dependency vala-0.34.4
Found dependency libsoup-2.56.0
Found dependency libdrm-2.4.75
Found dependency elfutils-0.168
Found dependency libvdpau-1.1.1
Found dependency OpenSSL-1.0.2
Found dependency certdata-8.0
Found dependency curl-7.52.1
Found dependency LZO-2.09
Found dependency libarchive-3.2.2
Found dependency CMake-3.7.2
Found dependency LLVM-3.9.1
Found dependency MesaLib-13.0.4
Found dependency Ruby-2.4.0
Found dependency libwebp-0.6.0
Found dependency libsecret-0.18.5
Found dependency webkitgtk-2

Of course some libs/apps are dependencies of multiple other apps/libs so be careful what you uninstall.

hazel 11-14-2017 08:17 AM

On Debian-based systems you can use the deborphan command to pick out "orphaned" packages.

Keith Hedger 11-14-2017 09:12 AM

Quote:

Originally Posted by hazel (Post 5780546)
On Debian-based systems you can use the deborphan command to pick out "orphaned" packages.

This is the LFS sub-forum the OP's sidebar says they are using LFS, your answer is irrelevant as LFS is NOT debian based.

hazel 11-14-2017 10:52 AM

Quote:

Originally Posted by Keith Hedger (Post 5780563)
This is the LFS sub-forum the OP's sidebar says they are using LFS, your answer is irrelevant as LFS is NOT debian based.

Sorry, careless of me!

Keith Hedger 11-14-2017 11:16 AM

No problem

hariskar 11-15-2017 03:29 AM

Quote:

Originally Posted by Keith Hedger (Post 5780531)
Of course some libs/apps are dependencies of multiple other apps/libs so be careful what you uninstall.

This is exactly my problem. To find the dependencies is quite easy, because it is written in the book. But to find the dependencies that are not used by any other program, how can that be done? Especialy now that I have installed apps like Chromium and Webkit and I have not kept track...

Keith, your package manager can be used for something like that on svn?

Thank you for help!

Keith Hedger 11-15-2017 04:35 AM

Quote:

Originally Posted by hariskar (Post 5780852)
... Keith, your package manager can be used for something like that on svn? ...

Not sure what you mean by this, what has svn got to do with it?

hariskar 11-15-2017 05:03 AM

Sorry about svn. What I wanted to ask is if your package manager can find the dependencies of a package that will be uninstalled, that can safely be uninstalled because they are not dependenies of any other package.

Keith Hedger 11-15-2017 07:21 AM

Yes, but only those packages installed by the package manager ( and their dependencies installed by the package manager ), some other pkg managers can do this but usually only for packages and deps installed by the manager itself, if you install something outside of the manager of it will know nothing about it, doing it retroactively is really difficult.
E.G:
Code:

keithhedger@LFSDev:~-> lfspkg -h
lfspkg - Version 0.4.20
Useage: lfspkg [option] ...
-c|--commit : Make and Install package
-i|--install : Install package
-m|--make : Make package
-u|--upgrade : Upgrade package
-r|--remove : Remove package
-t|--template : Create LFSBuild template for source tarball
-q|--qttemplate : Create LFSBuild template for QT5 source tarball
-l|--list : List installed files
-f|--find : Find installed file
-L|--less : Pipe output from list/find to less
-M|--remake : Re-consitute an installed package
-B|--builddeps : Build all dependant packages
-F|--finddepends : Find dependencies and build scripts.
-j|--justlist : Just output list if query results in multiple packages
-a|--preinstall : Re-run the preinstall script for PKG
-A|--postinstall : Re-run the postinstall script for PKG
-I|--info : Try to make info file from lfs/blfs website
-D|--pkginfo : Print info for installed package
-C|--check : Try to check package version
-U|--rebuild : Re-build database
-S|--search : Search database PACKAGENAME DATANEEDED 0/nothing=all,1=name,2=script version,3=path,4=depends,5=installed,6=installed version
-T|--notinstalled : List packages not installed
-E|--installed : List installed packages
-O|--dependson : Find packages that depend on ARG
-P|--checkall : Check all packages for possible upgrade
-W|--webpage : Try to find webpage for build
-K|--nocolour : Use colour in output default=on
-Q|--setup : Setup lfspkg.rc file
-N|--noaskroot : Don't check for root user
-R|--rootdir : use ROOTDIR as install/remove prefix
-s|--suffix : Suffix of package
-d|--section : Section of package
-b|--build : Build of package
-o|--output : Output archive to this folder
-n|--name : Name of package
-p|--pkgversion : Version of package
keithhedger@LFSDev:~-> lfspkg  -O python
Dependencies for python:
calibre-3.8.0 - /LFSPkgBuildScripts/desktop/calibre/calibre2.LFSBuild/
calibre-3.8.0 - /LFSPkgBuildScripts/desktop/calibre/calibre.LFSBuild/
gegl-0.3.12 - /LFSPkgBuildScripts/desktop/gegl/gegl.LFSBuild/
obtheme-2013.2.20.2 - /LFSPkgBuildScripts/desktop/obtheme/obtheme.LFSBuild/
asciidoc-8.6.9 - /LFSPkgBuildScripts/devel/asciidoc/asciidoc.LFSBuild/
bazaar-2.5.1 - /LFSPkgBuildScripts/devel/bazaar/bazaar.LFSBuild/
doxygen-1.8.13 - /LFSPkgBuildScripts/devel/doxygen/doxygen.LFSBuild/
git-2.11.1 - /LFSPkgBuildScripts/devel/git/git.LFSBuild/
gtk-doc-1.25 - /LFSPkgBuildScripts/devel/gtk-doc/gtk-doc.LFSBuild/
meld-1.8.6 - /LFSPkgBuildScripts/devel/meld/meld.LFSBuild/
ninja-1.7.2 - /LFSPkgBuildScripts/devel/ninja/ninja.LFSBuild/
scons-2.3.6 - /LFSPkgBuildScripts/devel/scons/scons.LFSBuild/
yasm-1.3.0 - /LFSPkgBuildScripts/devel/yasm/yasm.LFSBuild/
libevdev-1.5.6 - /LFSPkgBuildScripts/hware/libevdev/libevdev.LFSBuild/
qemu-2.8.0 - /LFSPkgBuildScripts/hware/qemu/qemu.LFSBuild/
boost-1.63.0 - /LFSPkgBuildScripts/libs/boost/boost.LFSBuild/
glib-2.50.3 - /LFSPkgBuildScripts/libs/glib/glib.LFSBuild/
youtube-dl-2017.11.06 - /LFSPkgBuildScripts/mm/youtube-dl/youtube-dl.LFSBuild/
js-17.0.0 - /LFSPkgBuildScripts/net/js/js.LFSBuild/
samba-4.5.5 - /LFSPkgBuildScripts/net/samba/samba.LFSBuild/
wicd-1.7.3 - /LFSPkgBuildScripts/net/wicd/wicd.LFSBuild/
Cython-0.23.4 - /LFSPkgBuildScripts/python/Cython/Cython.LFSBuild/
dbus-python-1.2.0 - /LFSPkgBuildScripts/python/dbus-python/dbus-python.LFSBuild/
fuse-python-0.2.1 - /LFSPkgBuildScripts/python/fuse-python/fuse-python.LFSBuild/
html2text-3.200.3 - /LFSPkgBuildScripts/python/html2text/html2text.LFSBuild/
Imaging-1.1.7 - /LFSPkgBuildScripts/python/Imaging/Imaging.LFSBuild/
py2cairo-1.10.0 - /LFSPkgBuildScripts/python/py2cairo/py2cairo.LFSBuild/
pyqt-5.8 - /LFSPkgBuildScripts/python/PyQt/PyQt.LFSBuild/
pysetuptools-18.2 - /LFSPkgBuildScripts/python/pysetuptools/pysetuptools.LFSBuild/
sip-4.19.1 - /LFSPkgBuildScripts/python/sip/sip.LFSBuild/
itstool-2.0.2 - /LFSPkgBuildScripts/sys/itstool/itstool.LFSBuild/
llvm-3.9.1 - /LFSPkgBuildScripts/xorg/llvm/llvm.LFSBuild/
mesalib-13.0.4 - /LFSPkgBuildScripts/xorg/MesaLib/MesaLib.LFSBuild/
xcb-proto-1.12 - /LFSPkgBuildScripts/xorg/xcb-proto/xcb-proto.LFSBuild/

This is listing packages that depend on python and the location of the build script.

hariskar 11-16-2017 04:47 AM

Can your package manager handle installations that need patches or more complicated installations like Chromium?
Do I have to install your package manager on chapter 6 or can I use it from now on to handle what I install from now on?

Keith Hedger 11-16-2017 04:51 AM

It can be installed at any point after the chapter 5.
Packages are made from compiled source so any patches etc are applied while building the package, and yes therenis a build scricpt for chromium

hariskar 11-21-2017 01:20 AM

Although a package manager would make my life easier, I would like to find solutions without a package manager, because that is why I left Gentoo and installed LFS, to have everything manual.
So, I would be greatful if you can make suggestions to this direction.
Thank you!

hariskar 02-28-2020 08:26 AM

Do you think GraphViz would help to track the dependency tree of installed packages?

Keith Hedger 02-28-2020 11:50 AM

Quote:

Originally Posted by hariskar (Post 6095150)
Do you think GraphViz would help to track the dependency tree of installed packages?

Graphviz is not an easy to use app would take more effort than its worth plus all the extra deps it would need.


All times are GMT -5. The time now is 09:11 PM.