<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Dependency Discovery - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=Dependency_Discovery&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.40.0</generator>
		<lastBuildDate>Wed, 08 Apr 2026 12:51:55 GMT</lastBuildDate>
		<item>
			<title>Gabim at 13:32, 8 July 2009</title>
			<link>https://www.slackwiki.com/index.php?title=Dependency_Discovery&amp;diff=220&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Dependency_Discovery&amp;diff=220&amp;oldid=prev</guid>
			<description>&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:32, 8 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Information&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tips&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tutorials]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</description>
			<pubDate>Wed, 08 Jul 2009 13:32:56 GMT</pubDate>
			<dc:creator>Gabim</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Dependency_Discovery</comments>
		</item>
		<item>
			<title>Gabim: Created page with 'Category:Information Category:Tutorials   == Introduction ==  &quot;Slackware users typically prefer their method of manual dependency resolution, citing the level of system c...'</title>
			<link>https://www.slackwiki.com/index.php?title=Dependency_Discovery&amp;diff=219&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Dependency_Discovery&amp;diff=219&amp;oldid=prev</guid>
			<description>&lt;p&gt;Created page with &amp;#039;&lt;a href=&quot;/Category:Information&quot; title=&quot;Category:Information&quot;&gt;Category:Information&lt;/a&gt; &lt;a href=&quot;/Category:Tutorials&quot; title=&quot;Category:Tutorials&quot;&gt;Category:Tutorials&lt;/a&gt;   == Introduction ==  &amp;quot;Slackware users typically prefer their method of manual dependency resolution, citing the level of system c...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Information]]&lt;br /&gt;
[[Category:Tutorials]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Slackware users typically prefer their method of manual dependency resolution, citing the level of system control it grants them.&amp;quot; - as the [http://wiki.archlinux.org/index.php/Arch_Compared_To_Other_Distros#Arch_vs_Slackware ArchWiki] says. This total control over the system is one of the main strength of the Slackware distribution.&lt;br /&gt;
&lt;br /&gt;
If the administrator of the system knows every package on the system and ensures their every dependencies, then the system is stable, well usable. If the administrator installs a new, (until now) unknown application, then he/she needs to discover its dependencies via the attached README or documentations, or from starting the application (if something is not installed on the system, then the application won't start).&lt;br /&gt;
&lt;br /&gt;
== Dependency resolution at package installation ==&lt;br /&gt;
&lt;br /&gt;
The dependency resolution can be performed at package installation, if we use a third party package manager, see [[Third_Party_Package_Managers]]. This is very easy, but we should use that third party package manager and maybe we don't want to do it just for a simple package installation. We would like a more Slackware like solution.&lt;br /&gt;
&lt;br /&gt;
== Dependency discovery as a separate task ==&lt;br /&gt;
&lt;br /&gt;
We can discover the dependencies of our system in separate task using the '&amp;lt;code&amp;gt;ldd&amp;lt;/code&amp;gt;' command. This is not third party application, it is the part of our system.&lt;br /&gt;
&lt;br /&gt;
We can scan the binaries in our PATH:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 &lt;br /&gt;
 ECHO=/usr/bin/echo&lt;br /&gt;
 SED=/usr/bin/sed&lt;br /&gt;
 FILE=/usr/bin/file&lt;br /&gt;
 CUT=/usr/bin/cut&lt;br /&gt;
 LDD=/usr/bin/ldd&lt;br /&gt;
 GREP=/usr/bin/grep&lt;br /&gt;
 AWK=/usr/bin/awk&lt;br /&gt;
 &lt;br /&gt;
 for p in `$ECHO $PATH | $SED 's/:/ /g'`&lt;br /&gt;
 do&lt;br /&gt;
     for f in $p/*&lt;br /&gt;
     do&lt;br /&gt;
         if [ 'ELF' == `$FILE -b $f | $CUT -d' ' -f1` ]; then&lt;br /&gt;
             if $LDD $f | $GREP -q 'not found'; then&lt;br /&gt;
                 $ECHO &amp;quot;$f&amp;quot;&lt;br /&gt;
                 $LDD $f | $GREP 'not found' | $AWK '{print &amp;quot;Not found:&amp;quot;, $1}'&lt;br /&gt;
             fi&lt;br /&gt;
         fi&lt;br /&gt;
     done&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Or, we can print the missing package names instead of the missing library names, so we have to install only the given packages mentioned by this script (I used the concatenated MANIFEST file of '&amp;lt;code&amp;gt;slackpkg&amp;lt;/code&amp;gt;' on Slackware64, this file list is more friendlier for scripting):&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # This is the concatenated MANIFEST file of slackpkg on Slackware64&lt;br /&gt;
 MANIFEST=/var/lib/slackpkg/slackware64-filelist.gz&lt;br /&gt;
 &lt;br /&gt;
 # Do not trust in any command in PATH, shell builtins, etc.&lt;br /&gt;
 ECHO=/usr/bin/echo&lt;br /&gt;
 PRINTF=/usr/bin/printf&lt;br /&gt;
 CUT=/usr/bin/cut&lt;br /&gt;
 SORT=/usr/bin/sort&lt;br /&gt;
 GREP=/usr/bin/grep&lt;br /&gt;
 ZGREP=/usr/bin/zgrep&lt;br /&gt;
 SED=/usr/bin/sed&lt;br /&gt;
 AWK=/usr/bin/awk&lt;br /&gt;
 FILE=/usr/bin/file&lt;br /&gt;
 LDD=/usr/bin/ldd&lt;br /&gt;
 NULL=/dev/null&lt;br /&gt;
 &lt;br /&gt;
 # Check all directories in PATH&lt;br /&gt;
 for directory in `$ECHO $PATH | $SED 's/:/ /g'`&lt;br /&gt;
 do&lt;br /&gt;
     # Check all binaries in PATH directories&lt;br /&gt;
     for binary in $directory/*&lt;br /&gt;
     do&lt;br /&gt;
         # If it is true ELF binary&lt;br /&gt;
         if [ 'ELF' == `$FILE -b $binary | $CUT -d' ' -f1` ]; then&lt;br /&gt;
             # Show the progress by printing of actual filename on standard error&lt;br /&gt;
             $PRINTF &amp;quot;%-70s\r&amp;quot; $binary &amp;gt;&amp;amp;2&lt;br /&gt;
             # Check the missing shared library dependencies&lt;br /&gt;
             $LDD $binary 2&amp;gt;$NULL | $GREP 'not found' | $AWK '{print $1}' | while read missing_lib&lt;br /&gt;
             do&lt;br /&gt;
                 # Print the package name of the missing library&lt;br /&gt;
                 $ZGREP $missing_lib $MANIFEST | $AWK '{print $1}'&lt;br /&gt;
             done&lt;br /&gt;
         fi&lt;br /&gt;
     done&lt;br /&gt;
     # Clear the progress info&lt;br /&gt;
     $PRINTF &amp;quot;%-80s\r&amp;quot; &amp;quot;&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
 # Ignore the duplicated package names&lt;br /&gt;
 done | $SORT -u&lt;br /&gt;
&lt;br /&gt;
If we would like to scan the binaries of the PATH and the shared libraries of our system, then we need a deeper directory discovery:&lt;br /&gt;
 #!/bin/bash                                                             &lt;br /&gt;
 &lt;br /&gt;
 # This is the concatenated MANIFEST file of slackpkg on Slackware64&lt;br /&gt;
 MANIFEST=/var/lib/slackpkg/slackware64-filelist.gz&lt;br /&gt;
 &lt;br /&gt;
 # Do not trust in any command in PATH, shell builtins, etc.&lt;br /&gt;
 SYSPATH=$PATH&lt;br /&gt;
 PATH=/bin:/usr/bin:/usr/sbin&lt;br /&gt;
 ECHO=/usr/bin/echo&lt;br /&gt;
 PRINTF=/usr/bin/printf&lt;br /&gt;
 &lt;br /&gt;
 # Check all directories in PATH and ld.so.conf&lt;br /&gt;
 # If it is true ELF binary&lt;br /&gt;
 find `$ECHO $SYSPATH | sed 's/:/ /g'` \&lt;br /&gt;
      `sed 's/\(\/.*\/.*\)\/.*/\1/' /etc/ld.so.conf | sort -u` \&lt;br /&gt;
      -perm -100 -a -type f \&lt;br /&gt;
      -exec sh -c 'filename=&amp;quot;{}&amp;quot;; /usr/bin/echo -n &amp;quot;.&amp;quot; &amp;gt;&amp;amp;2; \&lt;br /&gt;
                   [ &amp;quot;ELF&amp;quot; = `file -b $filename | cut -d&amp;quot; &amp;quot; -f1` ] &amp;amp;&amp;amp; \&lt;br /&gt;
                   ldd $filename 2&amp;gt;/dev/null | fgrep &amp;quot;not found&amp;quot; \&lt;br /&gt;
                       | cut -d&amp;quot; &amp;quot; -f1' \; | while read missing_lib&lt;br /&gt;
 do&lt;br /&gt;
     # Print the missing library and its package name&lt;br /&gt;
     $ECHO $missing_lib &amp;quot;: `zgrep $missing_lib $MANIFEST | cut -d&amp;quot; &amp;quot; -f1`&amp;quot;&lt;br /&gt;
 done | sort -u&lt;br /&gt;
&lt;br /&gt;
This small script will browse huge amount of directories and will scan a lot of ELF binaries, so it can run for a long time.&lt;br /&gt;
There are more effective ways of the dependency discovery, this is only a very simple solution for a natural system administrator need. It demonstrates that a Slackware user does not need a package manager with dependency resolution, but even so can have a stable, well configured system.&lt;/div&gt;</description>
			<pubDate>Wed, 08 Jul 2009 13:12:27 GMT</pubDate>
			<dc:creator>Gabim</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Dependency_Discovery</comments>
		</item>
</channel></rss>