Introduction
Slow download speeds during Ubuntu updates? The default repository mirror might be geographically distant or overloaded. Changing your Ubuntu 22.04 mirror link to a faster, closer server can dramatically improve package download speeds and system reliability. In this guide, we’ll walk you through two easy methods to switch mirrors—using the GUI or terminal—and help you optimize your system’s performance.
Why Change Ubuntu 22.04 Mirrors?
- Faster Downloads: Closer servers reduce latency.
- Improved Reliability: Avoid overloaded or outdated mirrors.
- Bandwidth Savings: Ideal for organizations managing multiple systems.
Method 1: Change Mirror via GUI (Software & Updates)
Step 1: Open Software & Updates
- Press the Super (Windows) key, search for “Software & Updates”, and open the app.
- Navigate to the Ubuntu Software tab.
Step 2: Select a New Mirror
- Under “Download from”, click the dropdown menu.
- Choose Other… > Select Best Server. Ubuntu will test mirrors and recommend the fastest.
- Alternatively, manually pick a country-specific mirror.
Step 3: Apply Changes
- Click Choose Server > Close.
- Reload package lists when prompted.
Method 2: Change Mirror via Terminal
Step 1: Back Up Sources List
Before editing, create a backup:
“`bash
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
#### **Step 2: Edit the Sources List**
1. Open the file in a text editor (e.g., Nano):
bash
sudo nano /etc/apt/sources.list
2. Replace the default mirror URL (e.g., `http://archive.ubuntu.com/ubuntu`) with your preferred mirror.
- For example, to use the **U.S. mirror**, replace with:
```
http://us.archive.ubuntu.com/ubuntu
```
- Find regional mirrors at [Ubuntu Mirror List](https://launchpad.net/ubuntu/+archivemirrors).
3. Save and exit (`Ctrl + O` > `Enter` > `Ctrl + X`).
#### **Step 3: Update Package Lists**
bash
sudo apt update
---
### **How to Verify the New Mirror**
Check if the mirror is active:
bash
sudo apt update | grep “http”
The output should show your selected mirror URL.
---
### **Troubleshooting Mirror Issues**
1. **Mirror Not Responding?**
- Revert to the default mirror using `Software & Updates` or restore your backup:
```bash
sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
sudo apt update
```
2. **Slow Speeds Persist?**
- Test another mirror from the [Ubuntu Mirror List](https://launchpad.net/ubuntu/+archivemirrors).
---
### **FAQs: Changing Ubuntu 22.04 Mirrors**
**Q: What’s the best mirror for Ubuntu?**
A: Use the *“Select Best Server”* tool in **Software & Updates** or choose one geographically closer.
**Q: Is changing mirrors safe?**
A: Yes, but always back up `/etc/apt/sources.list` first.
**Q: Do I need to update mirrors regularly?**
A: No—only if you experience slow speeds or errors.
**Q: Can I use a terminal-only method?**
A: Yes! Use `sed` to replace the mirror URL globally:
bash
sudo sed -i ‘s|http://archive.ubuntu.com/ubuntu|http://us.archive.ubuntu.com/ubuntu|g’ /etc/apt/sources.list
“`
Q: Why am I asked for a password?
A: Editing system files requires sudo
privileges.
Additional Tips
- Testing the Mirror:
If you’re unsure whether the new mirror is performing as expected, you can monitor download speeds during an update or installation. In some cases, you might find that even though a mirror is geographically closer, it could be overloaded. The Select Best Server option in the GUI helps avoid that. - Automated Tools:
For more advanced, automated handling of mirrors, you can explore tools like apt-mirror-updater. It’s a Python tool that can scan, rank, and switch to the best mirror on demand. This is particularly useful on headless systems or in scripted environments.
apt-mirror-updater
- Regional Customization:
If you reside in Rajshahi, Bangladesh, you might want to consider any available regional mirrors that could offer faster speeds compared to the global main server. Some university or local service providers sometimes host mirrors for popular distributions like Ubuntu.
Conclusion
Switching your Ubuntu 22.04 mirror link is a quick fix for sluggish updates and unreliable repositories. Whether you prefer the GUI’s simplicity or the terminal’s precision, this guide ensures you’ll enjoy faster downloads and a smoother system experience.
Call to Action:
Found a faster mirror or run into issues? Share your experience in the comments! For more Ubuntu optimization tips, subscribe to our newsletter.
Optimize your Ubuntu experience today with a faster mirror! 🚀🔧