运维部落

首页 > Linux, 解决方案 > ubuntu 17 更换apt源

ubuntu 17 更换apt源

2022年5月20日

有一些生产环境的服务器上的ubuntu 17 18系统很久没搞了。升级的源都太旧了。网上找了几个源,测试了一下更新。希望能对大家有帮助。

1
sudo vim /etc/apt/sources.list

清空,更换成以下内容。然后保存退出。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
deb-src http://archive.ubuntu.com/ubuntu artful main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ artful main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ artful main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ artful-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ artful-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ artful universe
deb http://mirrors.aliyun.com/ubuntu/ artful-updates universe
deb http://mirrors.aliyun.com/ubuntu/ artful multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ artful-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ artful-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu artful partner
deb-src http://archive.canonical.com/ubuntu artful partner
deb http://mirrors.aliyun.com/ubuntu/ artful-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ artful-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ artful-security universe
deb http://mirrors.aliyun.com/ubuntu/ artful-security multiverse
deb http://mirrors.aliyun.com/ubuntu bionic main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-updates main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu bionic-proposed main multiverse restricted universe

#将 /var/cache/apt/archives/ 的 所有 deb 删掉

1
sudo apt-get clean

#更新列表

1
2
sudo apt-get update -y
sudo apt-get upgrade -y

如果出现新完了之后,还出现了appstreamcli: error while loading shared libraries: libxapian.so.22: cannot open shared object file: No such file or directory
这之类的问题,按以下一般能解决。
解决方法:

1
2
3
4
5
apt --fix-broken install
apt-get install build-essential
apt-get install zlib1g-dev libc6-dev libc-dev libmysqlclient-dev
dpkg -l | grep libc6
apt-get install  libc6=2.19-0ubuntu6.9
» vps12.com:http://www.vps12.com
» 转载请注明来源:运维部落 » 《ubuntu 17 更换apt源》
分类: Linux, 解决方案 标签: , ,
本文的评论功能被关闭了.