Ubuntu 16.04 configures domestic high-speed apt-get update source

Ubuntu 16.04 download software is a bit slow, because the default is to download software from abroad, then replace it with a better fast update source in China (that is, the server where these software are located). Generally, a lot of Baidu Ubuntu update sources can come out directly. At this time, it is best to find an update source that is consistent with your own Ubuntu version. My Ubuntu version is 16.04. The following is a better update source I found.

1. Find domestic mirror sources

https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/


2. Configure the source list source

The sources.list comes with the system, and the source is from Ubuntu's official website! The installation package is relatively slow, so it is best to switch to domestic

linuxidc.com@ubuntu:~$ cd /etc/apt

linuxidc.com@ubuntu:/etc/apt$ sudo cp sources.list sources.list.bak

linuxidc.com@ubuntu:/etc/apt$ vim sources.list                                                 

# The source image is annotated by default to improve the speed of apt update, if necessary, you can uncomment it yourself

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

# Pre-release software source, it is not recommended to enable

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse

3. Update source

linuxidc.com@ubuntu:/etc/apt$ sudo apt-get update 

命中: 1 http://mirrors.aliyun.com/ubuntu great InRelease

命中: 2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease        

命中: 3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease      

命中: 4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease        

Reading package list... done 

Test: install sl package

linuxidc.com@ubuntu:/etc/apt$ sudo apt-get install sl

linuxidc.com@ubuntu:/etc/apt$ sl

4. Some other commands

sudo apt-get update update source

sudo apt-get install package install package

sudo apt-get remove package remove package

sudo apt-cache search package Search for packages

sudo apt-cache show package Get information about the package, such as description, size, version, etc.

sudo apt-get install package --reinstall to reinstall the package

sudo apt-get -f install to fix the installation

sudo apt-get remove package --purge removes packages, including configuration files, etc.

sudo apt-get build-dep package install related compilation environment

sudo apt-get upgrade to update installed packages

sudo apt-get dist-upgrade upgrade system

sudo apt-cache depends package to understand which packages are depended on using this package

sudo apt-cache rdepends package to see which packages depend on the package

sudo apt-get source package to download the source code of the package

sudo apt-get clean && sudo apt-get autoclean clean useless packages

sudo apt-get check to check for broken dependencies


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325382049&siteId=291194637