مرجع سريع

ورقة غش مدير الحزم Pacman

دليل مرجعي سريع لمدير الحزم Pacman على Arch Linux: التثبيت، الترقية، الإزالة، مزامنة قواعد البيانات، تنظيف اليتامى، وفحص شجرة الاعتماديات.

· تاريخ النشر

Pacman هو مدير الحزم المعتمد في توزيعة Arch Linux والتوزيعات المشتقة منها، ويجمع بين صيغة حزم ثنائية بسيطة ونظام بناء سهل الاستخدام.

العمليات الأساسية

الأمر الإجراء
sudo pacman -Syu مزامنة قواعد البيانات وترقية النظام بالكامل
sudo pacman -S <pkg> تثبيت حزمة محددة
sudo pacman -Syu <pkg> تحديث المستودعات وتثبيت الحزمة
sudo pacman -R <pkg> إزالة الحزمة (مع إبقاء اعتمادياتها)
sudo pacman -Rsc <pkg> إزالة الحزمة مع اعتمادياتها غير المطلوبة بشكل متكرر
pacman -Ss <keyword> البحث في المستودعات البعيدة بكلمة مفتاحية

الاستعلام عن الحزم (-Q)

# List all explicitly installed packages
pacman -Qe

# List all files installed by a specific package
pacman -Ql nginx

# Search for the package that owns a specific file
pacman -Qo /usr/bin/git

# Show detailed metadata and dependencies for installed package
pacman -Qi python

# Search locally installed packages for keywords
pacman -Qs ripgrep

تنظيف الاعتماديات اليتيمة

الحزم اليتيمة هي حزم ثُبّتت كاعتماديات ولم تعد مطلوبة لأي حزمة نشطة:

# List orphan packages
pacman -Qdt

# Remove all orphan packages and their unused configurations
sudo pacman -Rns $(pacman -Qdtq)

# Clean cached package downloads (/var/cache/pacman/pkg/)
sudo pacman -Sc

فحص شجرة الاعتماديات (pactree)

# View dependency tree for a package
pactree ripgrep

# View reverse dependencies (what packages depend on this)
pactree -r openssl

المراجع

موضوعات ذات صلة