由于下载使用aptitude自动删除apt
使用dpkg -r aptitude
之后再
http://security.ubuntu.com/ubuntu/pool/main/a/apt/
下载apt_1.2.35_amd64.deb文件
使用dpkg -i apt_1.2.35_amd64.deb安装新的apt文件
之后迁移 mv /var/lib/dpkg/info /var/lib/dpkg/info.bat
使用apt-get update
root@7a3edb13d737:/home/uav_demo# apt update
Hit:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:6 http://archive.canonical.com/ubuntu xenial InRelease
Reading package lists... Done
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: The method driver /usr/lib/apt/methods/https could not be found.
N: Is the package apt-transport-https installed?
E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/InRelease
E: Failed to fetch https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/InRelease
E: Some index files failed to download. They have been ignored, or old ones used instead.
添加cuda源
echo "deb http://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list
echo "deb http://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list
再次使用apt-get update 成功
root@7a3edb13d737:/home/uav_demo# apt update
Hit:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease
Ign:5 http://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 InRelease
Hit:6 http://archive.canonical.com/ubuntu xenial InRelease
Ign:7 http://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64 InRelease
Get:8 http://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 Release [696 B]
Get:9 http://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64 Release [564 B]
Get:10 http://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 Release.gpg [836 B]
Get:11 http://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64 Release.gpg [833 B]
Get:12 http://developer.download.nvidia.cn/compute/cuda/repos/ubuntu1804/x86_64 Packages [872 kB]
Get:13 http://developer.download.nvidia.cn/compute/machine-learning/repos/ubuntu1804/x86_64 Packages [73.8 kB]
Hit:14 http://archive.ubuntu.com/ubuntu xenial InRelease
Fetched 949 kB in 2s (567 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
mv /var/lib/dpkg/info.bat /var/lib/dpkg/info
再次使用apt-get update
使用apt-get upgrade 此处可能会有一些依赖报错
使用apt-get -f install即可解决