Skip to content

Instantly share code, notes, and snippets.

@hasan2001jk
Created April 22, 2024 16:22
Show Gist options
  • Save hasan2001jk/51707a7c0276386df358123c914ff9c3 to your computer and use it in GitHub Desktop.
Save hasan2001jk/51707a7c0276386df358123c914ff9c3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check if a file was provided
if [ -z "$1" ]
then
echo "Please provide a .deb file"
exit 1
fi
# Check if file exists
if [ ! -f "$1" ]
then
echo "$1 does not exist."
exit 1
fi
# Extract package name and dependencies
PACKAGE_NAME=$(dpkg-deb -f "$1" Package)
DEPENDENCIES=$(dpkg-deb -f "$1" Depends)
# Output the results
echo "Package Name: $PACKAGE_NAME"
echo "Dependencies: $DEPENDENCIES"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment