Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

linux check package manager


declare -A osInfo;
osInfo[/etc/redhat-release]=yum
osInfo[/etc/arch-release]=pacman
osInfo[/etc/gentoo-release]=emerge
osInfo[/etc/SuSE-release]=zypp
osInfo[/etc/debian_version]=apt-get
osInfo[/etc/alpine-release]=apk

for f in ${!osInfo[@]}
do
    if [[ -f $f ]];then
        echo Package manager: ${osInfo[$f]}
    fi
done


===============run insdide termial
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu get current path 
Shell :: tailwind vite 
Shell :: sudo rm rf hack 
Shell :: revert last merge git 
Shell :: git push local branch to existing remote 
Shell :: revert commit git 
Shell :: remove package from laravel 
Shell :: change branch name 
Shell :: Install Zenkit on Linux 
Shell :: random color npm 
Shell :: how to setup wordpress in docker 
Shell :: stop docker image 
Shell :: pod install react native failed 
Shell :: python not found. install python-is-python3 
Shell :: install raylib osx 
Shell :: kubernetes while true sleep 
Shell :: dpkg install force 
Shell :: debian 9.4 telnet install 
Shell :: bash cut delimiter last field 
Shell :: ntfsfix ubantu 
Shell :: added changes to a specific commit 
Shell :: docker install ubuntu command line 
Shell :: git checkout previous commit 
Shell :: git pull with ssh 
Shell :: delete branches gitlab 
Shell :: remove frmo staging git 
Shell :: unity localization 
Shell :: download docker desktop ubuntu 
Shell :: sh vs bash 
Shell :: WslRegisterDistribution failed with error: 0x8000000d 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =