首先是官方源,虽然慢,但是不容易有问题。
deb http://us.ports.ubuntu.com/ubuntu-ports/ bionic main restricted
#deb-src http://us.ports.ubuntu.com/ubuntu-ports/ bionic main restricted
deb http://us.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
#deb-src http://us.ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted
#deb-src http://ports.ubuntu.com/ubuntu-ports bionic-security main restricted
deb http://us.ports.ubuntu.com/ubuntu-ports/ bionic universe
#deb-src http://us.ports.ubuntu.com/ubuntu-ports/ bionic universe
deb http://us.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
#deb-src http://us.ports.ubuntu.com/ubuntu-ports/ bionic-updates universe
deb http://us.ports.ubuntu.com/ubuntu-ports/ bionic multiverse
#deb-src http://us.ports.ubuntu.com/ubuntu-ports/ bionic multiverse
deb http://us.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
#deb-src http://us.ports.ubuntu.com/ubuntu-ports/ bionic-updates multiverse
注意修改系统时间为当前时间,不然会报错,
华为源
wget -O /etc/apt/sources.list https://repo.huaweicloud.com/repository/conf/Ubuntu-Ports-bionic.list
apt-get update
deb https://repo.huaweicloud.com/ubuntu-ports/ bionic main restricted universe multiverse
deb-src https://repo.huaweicloud.com/ubuntu-ports/ bionic main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src https://repo.huaweicloud.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb-src https://repo.huaweicloud.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://repo.huaweicloud.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb-src https://repo.huaweicloud.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
## Not recommended
deb https://repo.huaweicloud.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse