HostOnNet Blog

Changing Ubuntu APT mirror from commandline

Looking for Linux Server Admin or WordPress Expert? We can help.

Last day i removed GUI from Ubuntu installation as i don’t need GUI in development machine. Today i run apt-get, found it is downloading packages from server located in USA. I need it to download files from Indian Ubuntu mirror server. This is done by editing


Finding all instance of

Replacing it With

You can do this with sed, run following command

sed -i "s/http:\/\/us.archive/http:\/\/in.archive/g" /etc/apt/sources.list

That will do all the find and replacement for you.

Posted in Ubuntu

Leave a Reply

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.