工具:VMWare15 Pro,Ubuntu20.4LTS,ClickHouse
1.
sudo apt-get install apt-transport-https ca-certificates dirmngr
报错:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 5472 (aptd)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
查看占用端口的进程:
$ ps -ef | grep 5472
root 5472 1 0 23:18 ? 00:00:01 /usr/bin/python3 /usr/sbin/aptd
_apt 5485 5472 0 23:18 ? 00:00:05 /usr/lib/apt/methods/http
ljh 5713 5611 0 23:27 pts/1 00:00:00 grep --color=auto 5472
发现是ubuntu的升级程序占用了锁,直接kill掉进程重试:
$ kill -9 5472
$ sudo apt-get install apt-transport-https ca-certificates dirmngr
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20190110ubuntu1).
ca-certificates set to manually installed.
dirmngr is already the newest version (2.2.19-3ubuntu2).
dirmngr set to manually installed.
The following NEW packages will be installed:
apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 59 not upgraded.
Need to get 1,704 B of archives.
After this operation, 160 kB of additional disk space will be used.
Do you want to continue? [Y/n]
启动成功了。
2.
$ sudo apt-key adv --keyserver