Skip to content

Instantly share code, notes, and snippets.

@tkhoa2711
Last active December 8, 2015 05:51
Show Gist options
  • Save tkhoa2711/6c39dc5ed4ad516eab45 to your computer and use it in GitHub Desktop.
Save tkhoa2711/6c39dc5ed4ad516eab45 to your computer and use it in GitHub Desktop.
Check if a library is installed in UNIX
# http://serverfault.com/questions/54736/how-to-check-if-a-library-is-installed
# work 99% of the time
alias libcheck='ldconfig -p | grep '
# other ways
# for deb-based distribution
# dpkg -s packagename
# for exact filename search
# locate filename
# for redhat systems
# pkg-config --cflags jpeg
# pkg-config --libs jpeg
# pkg-config --cflags "jpeg >= 1.0.0" # for version check
# pkg-config --modversion jpeg | awk -F. '{ printf "0x%02X%02X%02X\n",$1,$2,$3 }' #version check
# for ubuntu
# dpkg -L packagename
# http://unix.stackexchange.com/questions/58846/viewing-linux-library-executable-version-info
# for redhat
# yum info libname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment