أوامر استخدام apt و apt-get باختصار
ما هو apt ؟ 🔗
برنامج apt أو apt-get هو مدير حزم (package manager) مستخدم في توزيعة دبيان لينكس (Debian) وكل التوزيعات المبنية عليها مثل أوبونتو (Ubuntu) وبالطبع كل التوزيعات المبنية على أوبنتو أيضاً مثل إلمنتري (Elementary OS) و لينكس منت (Linux Mint).
أوامر استخدام مدير الحزم (apt) 🔗
تحديث سجل الحزم ومعرفة التحديثات المتاحة للبرامج والحزم المثبتة.
sudo apt update
# or
sudo apt-get update
أمر ترقية البرامج: تثبيت التحديثات لكل الحزم والبرامج المتاح لها تحديثات.
sudo apt upgrade
# or
sudo apt-get upgrade
أمر شامل يقوم بالبحث عن تحديثات لكل البرامج والحزم وتثبيتها.
sudo apt update && sudo apt upgrade -y
# or
sudo apt-get update && sudo apt-get upgrade -y
تثبيت حزمة (برنامج) على جهازك.
sudo apt install <package-name>
# or
sudo apt-get install <package-name>
مثال على أمر تثبيت برنامج vlc المتخصص في تشغيل فيديوهات على جهازك.
sudo apt install vlc
# or
sudo apt-get install vlc
أمر حذف برنامج أو إلغاء تثبيت حزمة محددة مع حذف ملف الإعدادات الخاص بالبرنامج (conf).
sudo apt --purge remove <package-name>
# or
sudo apt-get --purge remove <package-name>
مثال على أمر الحذف، حذف برنامج vlc المتخصص في تشغيل فيديوهات على جهازك.
sudo apt --purge remove vlc
# or
sudo apt-get --purge remove vlc
حذف كل ملفات الـ cache الخاص بالحزم والبرامج. مسار هذا المجلد الذي يتم حذف محتوياته في أوبونتو هو /var/cache/apt/archives/
.
sudo apt clean
# or
sudo apt-get clean
أمر حذف الحزم التي تم تثبيتها تلقائياً ﻷن أحد البرامج تعتمد عليها (dependency) وتم حذف البرامج أو الحزم التي تعتمد عليها ولم يعد لها حاجة لتستمر في التواجد بين الحزم المثبتة. لذلك نستخدم الأمر التالي لحذف مثل هذه الحزم.
ننصح باستخدام هذا الأمر، لأنه يحذف الملفات التي لا تستخدم حالياً (بعد التحديث مثلاً).
sudo apt autoremove
# or
sudo apt-get autoremove
البحث عن برنامج أو حزمة.
apt-cache search "package name"
مثال على البحث عن برنامج معين.
apt-cache search vlc
أما إن أردت أن تبحث في أسماء الحزم والبرامج فقط دون البحث في الوصف الخاص بالبرامج، استخدم الأمر التالي:
apt-cache search --names-only <search term>
مثال على البحث في أسماء الحزم والبرامج فقط عن vlc :
apt-cache search --names-only vlc
النتائج تكون بهذا الشكل:
$ apt-cache search --names-only vlc
gem-plugin-vlc - Graphics Environment for Multimedia - VLC support
libvlc-bin - tools for VLC's base library
libvlc-dev - development files for libvlc
libvlc5 - multimedia player and streamer library
libvlccore-dev - development files for libvlccore
libvlccore9 - base library for VLC and its modules
phonon-backend-vlc-common - Phonon VLC backends - shared files
phonon4qt5-backend-vlc - Phonon4Qt5 VLC backend
phonon4qt6-backend-vlc - Phonon4Qt6 VLC backend
python3-vlc - VLC Python bindings
vlc - multimedia player and streamer
vlc-bin - binaries from VLC
vlc-data - common data for VLC
vlc-l10n - translations for VLC
vlc-plugin-access-extra - multimedia player and streamer (extra access plugins)
vlc-plugin-base - multimedia player and streamer (base plugins)
vlc-plugin-bittorrent - Bittorrent plugin for VLC
vlc-plugin-fluidsynth - FluidSynth plugin for VLC
vlc-plugin-jack - JACK audio plugins for VLC
vlc-plugin-notify - LibNotify plugin for VLC
vlc-plugin-pipewire - PipeWire audio plugins for VLC
vlc-plugin-qt - multimedia player and streamer (Qt plugin)
vlc-plugin-samba - Samba plugin for VLC
vlc-plugin-skins2 - multimedia player and streamer (Skins2 plugin)
vlc-plugin-svg - SVG plugin for VLC
vlc-plugin-video-output - multimedia player and streamer (video output plugins)
vlc-plugin-video-splitter - multimedia player and streamer (video splitter plugins)
vlc-plugin-visualization - multimedia player and streamer (visualization plugins)
لكن هذه النتائج بلون واحد فقط! إن أردت الحصول على نفس النتائج بتنسيق جميل واضح وكلمات ملونة توضح المحتوى، استخدم الأمر التالي:
apt search --names-only vlc
ونتائج البحث تكون بهذا الشكل:
$ apt search --names-only vlc
Sorting... Done
Full Text Search... Done
gem-plugin-vlc/noble 1:0.94-8build4 amd64
Graphics Environment for Multimedia - VLC support
libvlc-bin/noble,now 3.0.20-3build6 amd64 [installed,automatic]
tools for VLC's base library
libvlc-dev/noble 3.0.20-3build6 amd64
development files for libvlc
libvlc5/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer library
libvlccore-dev/noble 3.0.20-3build6 amd64
development files for libvlccore
libvlccore9/noble,now 3.0.20-3build6 amd64 [installed,automatic]
base library for VLC and its modules
phonon-backend-vlc-common/noble,noble 0.12.0-3build3 all
Phonon VLC backends - shared files
phonon4qt5-backend-vlc/noble 0.12.0-3build3 amd64
Phonon4Qt5 VLC backend
phonon4qt6-backend-vlc/noble 0.12.0-3build3 amd64
Phonon4Qt6 VLC backend
python3-vlc/noble,noble 3.0.20123-1 all
VLC Python bindings
vlc/noble,now 3.0.20-3build6 amd64 [installed]
multimedia player and streamer
vlc-bin/noble,now 3.0.20-3build6 amd64 [installed,automatic]
binaries from VLC
vlc-data/noble,noble,now 3.0.20-3build6 all [installed,automatic]
common data for VLC
vlc-l10n/noble,noble,now 3.0.20-3build6 all [installed,automatic]
translations for VLC
vlc-plugin-access-extra/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (extra access plugins)
vlc-plugin-base/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (base plugins)
vlc-plugin-bittorrent/noble 2.15-1build3 amd64
Bittorrent plugin for VLC
vlc-plugin-fluidsynth/noble 3.0.20-3build6 amd64
FluidSynth plugin for VLC
vlc-plugin-jack/noble 3.0.20-3build6 amd64
JACK audio plugins for VLC
vlc-plugin-notify/noble,now 3.0.20-3build6 amd64 [installed,automatic]
LibNotify plugin for VLC
vlc-plugin-pipewire/noble 3-3build2 amd64
PipeWire audio plugins for VLC
vlc-plugin-qt/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (Qt plugin)
vlc-plugin-samba/noble,now 3.0.20-3build6 amd64 [installed,automatic]
Samba plugin for VLC
vlc-plugin-skins2/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (Skins2 plugin)
vlc-plugin-svg/noble 3.0.20-3build6 amd64
SVG plugin for VLC
vlc-plugin-video-output/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (video output plugins)
vlc-plugin-video-splitter/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (video splitter plugins)
vlc-plugin-visualization/noble,now 3.0.20-3build6 amd64 [installed,automatic]
multimedia player and streamer (visualization plugins)
أو استخدم الأمر :
apt-get search --names-only vlc
عرض معلومات الحزمة (البرنامج).
apt-cache show <package-name>
# or
apt-get show <package-name>
# or
apt show <package-name>
عرض كل حزم البرامج الموجودة في الـ repositories .
apt list
# or
apt-get list
عرض كل الحزم (البرامج) المثبتة على جهازك.
apt list --installed
# or
apt-get list --installed
عرض كل الحزم (البرامج) المتوفر لها تحديث حالياً.
apt list --upgradeable
# or
apt-get list --upgradeable
أما إن كنت تريد إضافة repository خارجي ، استخدم هذه الأوامر
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:some/repository
واكتب مستودع الكود (repository) بدلاً من “some/repository” في الأمر السابق.
لاحظ: ببساطة، يُمكنك استخدام apt بدلاً من apt-get (أو العكس) في كل الأوامر السابقة.
للوصول لهذه الصفحة بسهولة فيما بعد ابحث عن “أوامر apt موقع أبانوب” على أى محرك بحث مثل جوجل أو بنج أو دك دك جو ، أما إن كنت تفضل مشاهدة الفيديو أكثر من قراءة المقالات، اشترك في القناة على اليوتيوب من هنا .