# How To Configure TeraSwitch's Linux Mirrors on Ubuntu 18.04 ### Introduction <!-- Our articles have a specific structure. Learn more at https://do.co/style/structure --> 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` <!-- For more information on steps, see https://do.co/style/#steps --> 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: ```bash 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: ```bash 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: ```bash 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. ---- ---- ---- ### Editor's note: I encountered an issue testing this guide, which I'm not sure how to best resolve. ##### Expected behavior `apt-get upgrade` should complete with no errors ##### Observed behavior After running `sudo apt-get upgrade` a second time, I got this message: ![](https://i.imgur.com/uhLDFU8.png) ![](https://i.imgur.com/9bUiuCk.png) ##### Steps to reproduce 1. Create a VM at the legacy portal (portal.teraswitch.com) 2. Follow the steps in this guide, including running `sudo apt-get upgrade` 3. After that finishes, again run `sudo apt-get update && sudo apt-get upgrade` 4. Error message is thrown