- 首先要确定包的完整名字,比如列举的pcap,log4cpp等包都是因为包的名称不完整,所有无法定位的情况。
这个时候需要使用
apt list | grep xxx
xxx为找不到的库的名字,如
apt list | grep pcap
接下来就可以看到一堆库,尽量找libxxx-dev的安装,如果不行再安装别的库
2.可能是源不行,建议换源。
备份 以及修改
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
sudo gedit /etc/apt/sources.list
删除里面的所有内容,然后把阿里源镜像复制进去。
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse