วิธีการเปลี่ยน mirror update ใน linux
Back to articles

วิธีการเปลี่ยน mirror update ใน linux

วิธีการเปลี่ยน mirror update ใน linux

Linux Updated: January 30, 2026

วิธีการเปลี่ยน mirror update ใน Linux

การเปลี่ยน mirror สำหรับการอัปเดตในระบบปฏิบัติการ Linux ขึ้นอยู่กับตัวจัดการแพ็กเกจที่ใช้งาน:

1. APT (Debian, Ubuntu):

  1. แก้ไขไฟล์ /etc/apt/sources.list
    sudo nano /etc/apt/sources.list
  1. แทนที่ URL ที่ใช้งานอยู่ด้วย mirror ที่ต้องการ

  2. อัปเดตแคชของแพ็กเกจ:
    sudo apt update

2. YUM (Red Hat, CentOS ก่อน 8):

  1. ไปที่ /etc/yum.repos.d/ และแก้ไขไฟล์ .repo ที่คุณต้องการเปลี่ยน mirror

  2. แทนที่ URL ที่ใช้งานอยู่ด้วย mirror ที่ต้องการ

  3. ทำการล้างแคช:
    sudo yum clean all
sudo yum makecache

3. DNF (Fedora, CentOS 8 และถัดไป):

  1. ไปที่ /etc/yum.repos.d/ หรือ /etc/dnf/dnf.conf และแก้ไขไฟล์ .repo ที่คุณต้องการเปลี่ยน mirror

  2. แทนที่ URL ที่ใช้งานอยู่ด้วย mirror ที่ต้องการ

  3. ทำการล้างแคช:
    sudo dnf clean all
sudo dnf makecache

4. Pacman (Arch Linux):

  1. แก้ไขไฟล์ /etc/pacman.d/mirrorlist

  2. แทนที่หรือเรียงลำดับ mirror ในลิสต์ตามที่คุณต้องการ

  3. อัปเดตฐานข้อมูลแพ็กเกจ:
    sudo pacman -Sy

ข้อแนะนำ: ควรสำรองข้อมูลไฟล์ก่อนทำการแก้ไข และตรวจสอบว่า mirror ที่คุณเลือกมาใช้งานอยู่ในสถานะที่ดี และมีการอัปเดตที่สม่ำเสมอ เพื่อป้องกันปัญหาในการอัปเดตแพ็กเกจในอนาคต.

D

DriteStudio | ไดรท์สตูดิโอ

Cloud, VPS, Hosting and Colocation provider in Thailand

Operated by Craft Intertech (Thailand) Co., Ltd.

Manage your cookie settings

We use different types of cookies to optimize your experience on our website. Click on the categories below to learn more and customize your preferences. Note that blocking some types of cookies may impact your experience.

Necessary Cookies

These cookies are essential for the website to function properly. They enable basic functions like page navigation and access to secure areas.

View cookies used
  • Session cookies (session management)
  • Security cookies (CSRF protection)
Always On

Functional Cookies

These cookies enable personalized features like language preferences and theme settings. Without these, some features may not work properly.

View cookies used
  • lang (language preference)
  • theme (dark/light mode)

Analytics Cookies

These cookies help us understand how visitors interact with our website by collecting and reporting information anonymously.

View cookies used
  • _ga (Google Analytics)
  • _gid (Google Analytics)

Marketing Cookies

These cookies are used to track visitors across websites to display relevant advertisements based on your interests.

View cookies used
  • Advertising cookies
  • Remarketing pixels

Privacy Policy