Ubuntu apt domestic source configuration

Ubuntu APT source configuration

Brief introduction

Currently, Linux system has gradually been accepted by many developers and preferences, especially Ubuntu system is the Linux desktop systems do quite perfect, this paper focuses on modifying the default Ubuntu software installation tools apt software source, which is given to the Ubuntu the default source in foreign countries is slow, we modify the source Ali.

Specific steps

Backup configuration files

Just in case, you need the original apt source configuration file backup, use the following command. (Apt software source configuration file to /etc/apt/sources.listrecord all packages of the warehouse, as well as the same level under the same type of directories sources.list.d/to listsuffix text file.)
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

Viewing System Code

Many times online access apt source configuration tutorial, the results are not the same, because each version of Ubuntu, code-named systems are inconsistent, the command lsb_release -cview. For example, Ubuntu18.04 the code as follows.

Here Insert Picture Description

Modify the configuration file

The first step in the configuration file is modified as follows, Ali changed to the source, pay attention to the format.

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

As shown in FIG.

Here Insert Picture Description

The above-described format.

deb http://site.example.com/debian distribution component1 component2 component3
deb-src http://site.example.com/debian distribution component1 component2 component3

Several parameters classification is behind the software, the next major Ubuntu is four main, restricted, universe, multiverse.

Update software list

Execution sudo apt-get update, this time may be error GPG error: http://dl.google.com/linux/chrome/deb stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 78BD65473CB3BD13, this is a problem of public execution sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 报错说明的公钥can be added at this time to perform again sudo apt-get updateto update the software list.

Update Package

Run the sudo apt-get upgradesoftware update has been installed.

Supplement

This article describes how to modify the default software source Ubuntu18.04 apt source for Ali, accelerate the installation package.

Published 234 original articles · won praise 148 · Views 140,000 +

Guess you like

Origin blog.csdn.net/zhouchen1998/article/details/104496149