Adding mirrors in linux


If the mirror hostings are not available in source list, you can always add one.
First, to be on safe side, backup the sources.list before editing it.

sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
sudo vi /etc/apt/sources.list


The entries in the file follows like : type, location and components of a repository,
Here is what my sources.list look like after modifying.

deb http://ubuntu.ntc.net.np/ubuntu/ quantal main restricted multiverse
deb-src http://ubuntu.ntc.net.np/ubuntu/ quantal main
deb http://ubuntu.ntc.net.np/ubuntu/ quantal-updates main restricted multiverse
deb-src http://ubuntu.ntc.net.np/ubuntu/ quantal-updates main

deb http://ubuntu.ntc.net.np/ubuntu/ quantal universe
deb-src http://ubuntu.ntc.net.np/ubuntu/ quantal universe
deb http://ubuntu.ntc.net.np/ubuntu/ quantal-updates universe
deb-src http://ubuntu.ntc.net.np/ubuntu/ quantal-updates universe

deb http://ubuntu.ntc.net.np/ubuntu/ quantal-security main restricted multiverse
deb-src http://ubuntu.ntc.net.np/ubuntu/ quantal-security main
deb http://ubuntu.ntc.net.np/ubuntu/ quantal-security universe
deb-src http://ubuntu.ntc.net.np/ubuntu/ quantal-security universe

deb or deb-src, indicates the type of archive: whether it contains binary packages (deb), that is, the pre-compiled packages that we normally use, or source packages (deb-src).
http://ubuntu.ntc.net.np/ubuntu/ is the local repository hosted by NT, where I can find lots of packages necessary for apt-get. It may differ based on your location.

Make sure to run apt-get update after editing the /etc/apt/sources.list, APT will obtain the package lists from the sources mentioned.

Leave a comment

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.