1) Finding the right packages
Ubuntu/Debian "lib", .
"-dev", "-devel"
, , :
sudo apt-get update
apt-cache search <packagename>
... "lib" "dev" , . , .
2)
"dpkg -s", , , "rpm -qa", , , - . "dpkg-query -l", "grep", .
Here's what the equivalent part of the script looks like (with the correct correct package names and log_file output on a separate line):
#!/bin/bash
function stack_install()
{
log_file="$HOME/Desktop/stackoverflow/stack-log.txt"
req_libs=( libc6 e2fsprogs libkrb5-3 openssl )
for lib in ${req_libs[@]}
do
local present=$(dpkg-query -l "$lib" | grep "$lib" 2>/dev/null)
echo "$present" >> "$log_file"
if [ "$present" == "" ]; then
echo "The $lib library was not found installed in the dpkg database."
echo "See README for which libraries are required for the $driver_name."
return 1;
fi
done
}
stack_install
source
share