آخرین ویرایش فروردین ۶, ۱۴۰۵ حامد کوه فلاح
مقدمه: چرا تنظیم ریپوی پابلیک برای سرویسهای IT حیاتی است؟
در دنیای امروز، سرویسهای IT، تلفنی و ویپ بهطور مستقیم از ریپوهای بستههای نرمافزاری (Repository) برای بهروزرسانی و پشتیبانی سیستمها استفاده میکنند. با این حال، در شرایط قطعی اینترنت بینالملل یا اتصالات کند به ریپوهای خارجی، عملکرد این سرویسها بهطور قابل توجهی مختل میشود.
راهحلی پایدار و سریع:
استفاده از ریپوهای پابلیک محلی (مانند repo.abrha.net) بهجای ریپوهای خارجی، مزایایی مانند:
- سرعت دانلود بسیار بالاتر
- کاهش پهنای باند اینترنت
- دسترسی سریعتر به بستههای لازم
- پایداری بالا و آپتایم عالی
ایجاد میکند.
این مقاله بهطور کامل روش تنظیم ریپوهای EPEL، AlmaLinux، Debian و Ubuntu را با ارائه دستورات و نکات حیاتی آموزش میدهد.
نکته:
کاربران ایزابل ۵ می توانند از Alma8 و Epel8 به عنوان جایگزین های ریپو راکی برای ایزابل ۵ استفاده کنند.
۱. تنظیم ریپو EPEL (Extra Packages for Enterprise Linux)
EPEL 8 (CentOS/RHEL 8)
هدف:
EPEL یکی از مهمترین ریپوهای اضافی برای سیستمهای Enterprise Linux (RHEL/CentOS) است. استفاده از ریپوی محلی EPEL بهجای ریپوهای خارجی، بهطور قابل توجهی سرعت دانلود و پایداری را افزایش میدهد.
مراحل تنظیم:
- ایجاد فایل ریپو:
<strong>EPEL 8 (CentOS/RHEL 8)</strong> sudo tee /etc/yum.repos.d/epel.repo << 'EOF' [epel] name=Extra Packages for Enterprise Linux 8 - $basearch baseurl=https://repo.abrha.net/epel/8/Everything/$basearch/ enabled=1 gpgcheck=1 gpgkey=https://repo.abrha.net/epel/RPM-GPG-KEY-EPEL-8 [epel-debuginfo] name=Extra Packages for Enterprise Linux 8 - $basearch - Debug baseurl=https://repo.abrha.net/epel/8/Everything/$basearch/debug/ enabled=0 gpgcheck=1 gpgkey=https://repo.abrha.net/epel/RPM-GPG-KEY-EPEL-8 [epel-source] name=Extra Packages for Enterprise Linux 8 - Source baseurl=https://repo.abrha.net/epel/8/Everything/SRPMS/ enabled=0 gpgcheck=1 gpgkey=https://repo.abrha.net/epel/RPM-GPG-KEY-EPEL-8 EOF- EPEL 9 (CentOS/RHEL 9)
# Create repository file
sudo tee /etc/yum.repos.d/epel.repo << ‘EOF’
[epel]
name=Extra Packages for Enterprise Linux 9 – $basearch
baseurl=https://repo.abrha.net/epel/9/Everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=https://repo.abrha.net/epel/RPM-GPG-KEY-EPEL-9[epel-debuginfo]
name=Extra Packages for Enterprise Linux 9 – $basearch – Debug
baseurl=https://repo.abrha.net/epel/9/Everything/$basearch/debug/
enabled=0
gpgcheck=1
gpgkey=https://repo.abrha.net/epel/RPM-GPG-KEY-EPEL-9[epel-source]
name=Extra Packages for Enterprise Linux 9 – Source
baseurl=https://repo.abrha.net/epel/9/Everything/SRPMS/
enabled=0
gpgcheck=1
gpgkey=https://repo.abrha.net/epel/RPM-GPG-KEY-EPEL-9
EOF - پاک کردن کش و بهروزرسانی:
sudo yum clean all && sudo yum makecache
نکته:
برای سیستمهای EPEL 9 یا ۱۰، فقط نیاز به تغییر نام ریپو در فایل epel.repo دارید.
۲. تنظیم ریپو AlmaLinux
EPEL 8 (CentOS/RHEL 8)
هدف:
AlmaLinux بهعنوان جایگزین رایگان CentOS، پشتیبانی بلندمدت و پایداری بالا را فراهم میکند. استفاده از ریپوی محلی AlmaLinux سرعت دسترسی به بستهها را بهطور قابل توجهی افزایش میدهد.
مراحل تنظیم:
- ایجاد فایل ریپو:
<strong>EPEL 8 (CentOS/RHEL 8)</strong> sudo tee /etc/yum.repos.d/almalinux.repo << 'EOF' [almalinux-baseos] name=AlmaLinux $releasever - BaseOS baseurl=https://repo.abrha.net/almalinux/$releasever/BaseOS/$basearch/os/ enabled=1 gpgcheck=1 gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-8 [almalinux-appstream] name=AlmaLinux $releasever - AppStream baseurl=https://repo.abrha.net/almalinux/$releasever/AppStream/$basearch/os/ enabled=1 gpgcheck=1 gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-8 [almalinux-extras] name=AlmaLinux $releasever - Extras baseurl=https://repo.abrha.net/almalinux/$releasever/extras/$basearch/os/ enabled=1 gpgcheck=1 gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-8 EOF <strong>AlmaLinux 9</strong># Create repository file
sudo tee /etc/yum.repos.d/almalinux.repo << ‘EOF’
[almalinux-baseos]
name=AlmaLinux $releasever – BaseOS
baseurl=https://repo.abrha.net/almalinux/$releasever/BaseOS/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-9[almalinux-appstream]
name=AlmaLinux $releasever – AppStream
baseurl=https://repo.abrha.net/almalinux/$releasever/AppStream/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-9[almalinux-extras]
name=AlmaLinux $releasever – Extras
baseurl=https://repo.abrha.net/almalinux/$releasever/extras/$basearch/os/
enabled=1
gpgcheck=1
gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-9[almalinux-crb]
name=AlmaLinux $releasever – CRB
baseurl=https://repo.abrha.net/almalinux/$releasever/CRB/$basearch/os/
enabled=0
gpgcheck=1
gpgkey=https://repo.abrha.net/almalinux/RPM-GPG-KEY-AlmaLinux-9
EOF - پاک کردن کش و بهروزرسانی:
sudo yum clean all && sudo yum makecache
۳. تنظیم ریپو Debian
هدف:
Debian بهعنوان یکی از قدیمیترین و پایدارترین سیستمهای لینوکس، از ریپوهای خارجی برای دسترسی به بستهها استفاده میکند. استفاده از ریپوی محلی Debian سرعت دانلود را بهطور قابل توجهی افزایش میدهد.
مراحل تنظیم:
- ایجاد فایل ریپو:
# Backup original sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup# Disable ‘Valid-Until’ check (mirror outages)
echo ‘Acquire::Check-Valid-Until “false”;’ | sudo tee /etc/apt/apt.conf.d/99no-check-valid-until# Create new sources.list
sudo tee /etc/apt/sources.list << ‘EOF’
# Debian 10 Buster
deb https://repo.abrha.net/debian buster main contrib non-free
deb https://repo.abrha.net/debian buster-updates main contrib non-free
deb https://repo.abrha.net/debian buster-backports main contrib non-free
deb https://repo.abrha.net/debian-security buster/updates main contrib non-free
EOF - بهروزرسانی لیست بستهها:
sudo apt update
۴. تنظیم ریپو Ubuntu
Ubuntu 20.04 LTS (Focal Fossa)
هدف:
Ubuntu بهعنوان یکی از محبوبترین سیستمهای لینوکس، بهطور گسترده از ریپوهای خارجی استفاده میکند. استفاده از ریپوی محلی Ubuntu سرعت دسترسی به بستهها را بهطور قابل توجهی افزایش میدهد.
مراحل تنظیم:
- ایجاد فایل ریپو:
<span class="token-line"><span class="token plain"># Backup original sources.list</span> </span><span class="token-line"><span class="token plain">sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup</span> </span> <span class="token-line"><span class="token plain"># Create new sources.list</span> </span><span class="token-line"><span class="token plain">sudo tee /etc/apt/sources.list << 'EOF'</span> </span><span class="token-line"><span class="token plain"># Ubuntu 20.04 LTS Focal</span> </span><span class="token-line"><span class="token plain">deb https://repo.abrha.net/ubuntu focal main restricted universe multiverse</span> </span><span class="token-line"><span class="token plain">deb https://repo.abrha.net/ubuntu focal-updates main restricted universe multiverse</span> </span><span class="token-line"><span class="token plain">deb https://repo.abrha.net/ubuntu focal-backports main restricted universe multiverse</span> </span><span class="token-line"><span class="token plain">deb https://repo.abrha.net/ubuntu focal-security main restricted universe multiverse</span> </span><span class="token-line"><span class="token plain">EOF</span></span> - بهروزرسانی لیست بستهها:
sudo apt update
۵. نکات مهم و پیشنهادات
- استفاده از ریپوهای محلی: در شرایط قطعی اینترنت بینالملل، ریپوهای محلی بهطور قابل توجهی عملکرد سرویسها را بهبود میبخشند.
- بررسی منظم ریپوها: بهطور منظم ریپوهای تنظیمشده را چک کنید تا اطمینان حاصل شود که هیچگونه مشکلی در دسترسی به بستهها وجود ندارد.
- استفاده از GPG: فعالسازی GPG در ریپوها، امنیت دادهها را افزایش میدهد.
نتیجهگیری
با استفاده از ریپوهای پابلیک محلی (مانند repo.abrha.net)، میتوانید:
- سرعت دانلود را چندین برابر کنید
- پهنای باند اینترنت را بهطور قابل توجهی کاهش دهید
- پایداری سرویسهای IT، تلفنی و ویپ را در شرایط قطعی اینترنت بینالملل تضمین کنید
همچنین، این روشها بهطور کامل با تمام نسخههای EPEL، AlmaLinux، Debian و Ubuntu سازگار هستند.










