I have a Lucid Server (10.04) set up and I would like to change the mirror from US (or any other country) to the Main Ubuntu Mirror.
For example my two first entries in sources.list are:
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
In a Desktop environment I would select the main mirror like this:
But how do I do that from the terminal as I don't have a graphical environment installed!
apt-get update
subsequently so that APT can update its packages. Initially I got anPackage X has no installation candidate
message because APT hasn't yet scanned the new repository for packages. – dutoitns Nov 22 '16 at 09:00sed
command can be usedsed -E -i 's#http://[^\s]*archive\.ubuntu\.com/ubuntu#http://be.archive.ubuntu.com/ubuntu#g' /etc/apt/sources.list'
/etc/apt/sources.list replace nl with your country code. – Mandy Schoep Sep 06 '19 at 09:55sed -E -i 's#http://[a-z]*archive\.ubuntu\.com/ubuntu#http://be.archive.ubuntu.com/ubuntu#g' /etc/apt/sources.list'
(or without thebe.
-prefix/ a custom one, the problem was the prefix-regex) – polynomial_donut Feb 05 '20 at 12:53