Ubuntu and Linux Mint repositories within Mainland China

[lastupdated]

If you live in Mainland China, it can be extremely frustrating updating Ubuntu and/or Linux Mint from within the country if you are connecting to a foreign server because of the Great Firewall of China. In order to alleviate this problem, you should use Ubuntu repositories from within Mainland China. This article should work for any variants of Ubuntu as well which use Ubuntu’s repositories. This article is broken up into 2 parts. First is how to do it for Ubuntu 12.04 and Linux Mint 13 or any of their derivatives, and the 2nd half is how to do it for Ubuntu 14.04 and Linux Mint 17 or any of their derivatives. I can get extremely fast speeds updating from Ubuntu repositories in Mainland China. But, connecting to foreign repositories from Mainland China can be torturingly slow. So, in order to solve this dilemma, this article will describe how to connect to Ubuntu repositories in Mainland China. (Note: The following article describes step-by-step how to connect to Ubuntu repositories within Mainland China. But, if you wish to avoid configurations, you might want to consider using Ubuntu Kylin. Ubuntu describes Ubuntu Kylin via this link. “Ubuntu Kylin is an official flavour of Ubuntu. It is a free PC operating system created for China and complies with the Chinese government procurement regulations.” You can download Ubuntu Kylin at www.ubuntu.com/download/ubuntu-kylin or at http://cn.ubuntu.com/download/ )

Repositories For Ubuntu 12.04 and Linux Mint 13 or any of their derivatives
Ubuntu 12.04 and Linux Mint 13 repositories in Mainland China
1. Use Vim or another text editor using equivalent steps. If you prefer a more visual text editor, you can adjust the steps accordingly. The following instructions will be for vim, so you should adjust accordingly if you want to use another text editor. If you don’t have vim, type the following command without the quotes in order to install vim.
sudo apt-get install vim
After you finish that, then will you will do the following commands without the quotes after opening a terminal
“cd /etc/apt/”
“sudo vim sources.list”
This will allow you to edit your sources via command line, but you must do it correctly, else you could mess your computer up. Do the following:
First hit the ‘i’ key without the quotes to type in vim.
Edit out all of the lines already there by putting a hash “#” in front of all of the lines of the repositories on the left. Then, type the following and hit enter after every line.
deb http://cn.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu precise-updates restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu precise-proposed restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu precise-backports restricted universe multiverse
After finishing, it should look like the following picture:
Screenshot-Terminal
Once finished editing, hit the ‘esc’ key, and then “:wq” without the quotes to save the file.
After finishing, go back to your terminal, and type
sudo apt-get update
That will update the repositories. You can then check if have some updates to install. Now, will get updates for Ubuntu from within Mainland China, making the process significantly faster to update. You should uncomment the Linux Mint repositories only temporarily to edit Linux Mint things, but normally you should have it commented out to have it have the updating from within Mainland China be much faster.
For Ubuntu 14.04 and Linux Mint 17 or any of their derivatives
In Ubuntu 14.04 and Linux Mint 17, it is much easier to change to Chinese servers for Ubuntu and Linux Mint repositories. Note, the method for Ubuntu 12.04 and Linux Mint 13 might not work in Ubuntu 14.04 and Linux Mint 17, so only use the following method.
If using LXDE, go to Preferences → Software Sources
If using another desktop environment, just look for “Software Sources”
Then you will need to type in your password
The default Ubuntu setup should look like the following by default.
default_settings
You will need to choose a Chinese server for both the Main (qiana) Linux Mint repository, and the Base (trusty) Ubuntu.
Below is an example of a setup you can use.
software_sources
In this example, for the Main (qiana) Linux Mint repository, I have chosen to use mirrors.ustc.edu.cn/linuxmint/
For the Base (trusty) Ubuntu repository, I have chosen to use ubuntu.uestc.edu.cn/ubuntu/
You will just need then click on update cache, and then your repositories will be updated. Now, will get updates for Ubuntu from within Mainland China, making the process significantly faster to update. If you are outside of China, you should probably choose a non-Mainland China server. You can find the fastest servers closest to you by clicking on the mirror Main or Base, and Ubuntu will automatically ping various servers around the world, and find the fastest ones for you. Below is what I got today from my location in Paris, France.
opt_speed
Good luck, and you can post your results below in the comments.

Share this: