docker 中apt的错误

由于下载使用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即可解决

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值