Last active
August 8, 2024 14:14
-
-
Save realyukii/e3aef90c01fcd0c9a73911baa4abd677 to your computer and use it in GitHub Desktop.
on Arch Linux, there's a meta package, and a group package. this script will looking for installed meta package on your system with pacman.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to search for meta-packages in the local system | |
# Function to search for meta-packages | |
search_meta_packages() { | |
echo "Searching for meta-packages..." | |
for pkg in $(pacman -Qq); do | |
# Check if the package has dependencies but no installed files | |
files=$(pacman -Ql $pkg) # List package files | |
# if no contain any file, then it must be a meta package. | |
if [[ -z "$files" ]]; then | |
echo "Meta-package found: $pkg" | |
fi | |
done | |
} | |
search_meta_packages |
One-liner version: echo "Searching for meta-packages..."; for pkg in $(pacman -Qq); do if [[ -z "$(pacman -Ql $pkg)" ]]; then echo "Meta-package found: $pkg"; fi; done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can easily list all available group packages with just a single command:
pacman -Qg | cut -d ' ' -f 1 | uniq