Changing Ubuntu APT mirror from commandline

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