There was a problem loading the comments.

How To Configure TeraSwitch’s Linux Mirrors on Ubuntu 18.04

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Introduction

Today, most software for Ubuntu are downloaded using a package manager (apt-get) which retrieves packages from an official mirror.
TeraSwitch maintains up-to-date copies (a mirror) of all the official packages in our datacenter. By adjusting your configuration to use this mirror, your software updates will happen even faster.

Prerequisites

Before you begin this guide you’ll need the following:
  • One Linux VPS running Ubuntu 18.04

Step 1 — Editing sources.list

Your Ubuntu installation stores its list of mirrors in /etc/apt/sources.list.
If you like, you can create a backup copy of this file first:
sudo cp /etc/apt/sources.list{,.backup}
This creates a copy of sources.list and saves it as sources.list.backup.

Find and Replace

Next, run these commands:
sudo sed -i 's|http://archive.ubuntu.com/ubuntu|http://mirror.pit.teraswitch.com/ubuntu|g' /etc/apt/sources.list
sudo sed -i 's|http://us.archive.ubuntu.com/ubuntu|http://mirror.pit.teraswitch.com/ubuntu|g' /etc/apt/sources.list
sudo sed -i 's|http://security.ubuntu.com/ubuntu|http://mirror.pit.teraswitch.com/ubuntu|g' /etc/apt/sources.list
This will search /etc/apt/sources.list for any instance of the original mirrors, and replace them with the TeraSwitch mirror.

Step 2 — Update Packge List

Now you can update your list of available packages by typing:
sudo apt-get update
Output:
Hit:1 http://mirror.pit.teraswitch.com/ubuntu bionic InRelease
Get:2 http://mirror.pit.teraswitch.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:3 http://mirror.pit.teraswitch.com/ubuntu bionic-security InRelease [88.7 kB]
...

Conclusion

In this article you configured your VPS to use TeraSwitch’s official Ubuntu mirrors. Now any packages that you install from the official repositories can finish even faster.
Next, consider running sudo apt-get upgrade to rapidly upgrade your packages to their latest versions.

Share via
Did you find this article useful?  

Related Articles

© TeraSwitch Inc.