User Tools

Site Tools


package-manager-detection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

package-manager-detection [2020/04/21 16:41] (current)
dreiggy created
Line 1: Line 1:
 +====== Package manager detection ======
  
 +Snippet for package manager detection
 +
 +<code bash>
 +if [ $(rpm -qa 2>/dev/null | wc -l ) -gt 10 ]; then 
 +  system="rpm" 
 +elif [ $(dpkg -l 2>/dev/null | wc -l ) -gt 10 ]; then 
 +  system="dpkg" 
 +else 
 +  system="unk"
 +fi 
 +echo $system
 +</code>
package-manager-detection.txt ยท Last modified: 2020/04/21 16:41 by dreiggy