HiBlog
  • Home
  • Blog
  • Category
    • HiCademy
      Hosting and Server Articles
    • HiTube
      Educational Videos
    • HiCast
      Interesting Podcasts
    • Most Interesting
      Most Interesting Posts
  • About us
  • Contact Us
FA
EN
RU
Language:
FA
EN
RU
Article Stats
N/A
Category
Ali Ghanimati
Author
30 September 2025
Release Date
727
Views
FA
EN
RU
Post Languages
How to Configure Iranian Mirror on Ubuntu Servers

How to Configure Iranian Mirror on Ubuntu Servers

Table of Content

Article Stats
  1. The Importance of Choosing the Right Mirror in Ubuntu
  2. Setting Up the Iranian Mirror for Ubuntu
  3. Conclusion

One of the problems that Ubuntu server users face when installing their required packages is the slow download speed of the packages. Many users use the default mirrors to download packages, but these mirrors may not be suitable for servers inside Iran in terms of download speed. In this tutorial, we will teach you how to configure an Iranian mirror, also known as an Iranian repository, in Ubuntu to increase the speed of updating and downloading your packages.

The Importance of Choosing the Right Mirror in Ubuntu

While Ubuntu is very popular, you may encounter problems such as slow package downloads and system updates when using it. One of the main causes of these problems is choosing an inappropriate mirror for downloading packages and updates. This means that if you do not choose the right mirror, the download and update speeds will be drastically reduced. On the other hand, using domestic mirrors improves the package download speed on servers inside Iran. For this reason, choosing the right mirror for Ubuntu is very important and should be done with care and knowledge.

Setting Up the Iranian Mirror for Ubuntu

If you want to set up the Iranian mirror for your Ubuntu operating system, you can do so in SSH by following these steps:

Edit the sources.list file

Edit the sources.list file with root access. To do this, enter the following command in the terminal:

nano /etc/apt/sources.list

By running this command, the nano editor will open, and you can edit the sources.list file.

Change the Mirror to ir.archive.ubuntu.com

In the opened file, change all mirrors that start with http:// to http://ir.archive.ubuntu.com. For example, the address may be us.archive.ubuntu.com, in which case you should change the word “us” to “ir.”
Then press Ctrl + X and save the file.
The address ir.archive.ubuntu.com points to the Ubuntu mirror server inside Iran. This address is usually the Iranian Ubuntu repository for an Iranian company. Also, the Iranian repository server for this address may change and point to the server of another company.

Also, to make this easier without editing the file, we have written a terminal command for you that you can enter in SSH to do this automatically and quickly:


sed -i 's/http://[a-z]*.archive.ubuntu.com/http://ir.archive.ubuntu.com/g' /etc/apt/sources.list

This command finds the patterns http://*.archive.ubuntu.com and replaces them with http://ir.archive.ubuntu.com. Thus, all mirrors that start with the specified pattern in sources.list are replaced with the Iranian mirror.

Conclusion

In conclusion, setting up the appropriate mirror for the Ubuntu operating system can improve the speed of downloading and installing software packages and reduce download speed issues from foreign mirrors. Also, using domestic mirrors may help reduce communication costs. By following the steps outlined in this tutorial, you can select the appropriate mirror for your Ubuntu operating system and enjoy faster download and update speeds for software packages.

Share Post
hidata.org/en/blog/how-to-set-repository-mirror-on-ubuntu/
Copy Link
In Social Media

Add Comment

You’re replying to
captcha
Web Hosting
  • Professional cPanel Hosting
  • High-Traffic cPanel Hosting
  • File Hosting
Dedicated Server
  • Europe Dedicated Server
About HiData
Hi Data
Good Hosting Experience
Since April 2014, HiData has been hosting thousands of online businesses with strong and premium infrastructure in the best datacenters in Iran and worldwide. We use new-generation servers with powerful processors, high-capacity networks, and strict data security policies to meet your hosting needs at the highest standards. Our support team is available 24/7 through ticket and phone. Speed, stability, and peace of mind are not just promises. They are the identity of HiData.
Virtual Server
  • Germany NVMe VPS
  • Russia NVMe VPS
  • Turkey SSD VPS
  • Germany SATA VPS
  • Storage VPS
  • Cloud VPS
Other Services
  • Domain Services
  • Licensing System
  • Reseller
Phone 1: +98-9009019
HiTube HiCademy HiCast HiBlog
Address
HQ Address: Unit 8, 2nd Floor, Tala Commercial Complex, Imam Khomeini St., Abhar
Contact Phones
+98-9009019
24/7 Support
Support Email: info@hidata.org
© 2025 HiData
All rights reserved for hidata.org
HiData Store
The best prices for the world's leading brands