apt相關問題
apt找不到key或重複套件,刪掉有問題的apt key
sudo rm /etc/apt/sources.list.d/*cuda*
查看所有可以安裝的版本
apt-cache madison cuda
刪除apt key
顯示所有key
apt-key list
顯示結果如下1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17/etc/apt/trusted.gpg
--------------------
pub rsa4096 2022-05-05 [SCEA]
8298 D919 610D E70B 90CE DAAE EE38 2EF7 8230 7095
uid [ unknown] TensorRT <svc_tensorrt@nvidia.com>
/etc/apt/trusted.gpg.d/flexiondotorg_ubuntu_nvtop.gpg
-----------------------------------------------------
pub rsa1024 2011-03-16 [SC]
824A 27DD 09DE DA33 BF78 3596 2EA8 F357 93D8 809A
uid [ unknown] Launchpad PPA for Martin Wimpress
/etc/apt/trusted.gpg.d/graphics-drivers_ubuntu_ppa.gpg
------------------------------------------------------
pub rsa4096 2015-08-12 [SC]
2388 FF3B E10A 76F6 38F8 0723 FCAE 110B 1118 213C
uid [ unknown] Launchpad PPA for Graphics Drivers Team刪掉key
以下面為例,key ID就是最後8碼82307095
,sudo apt-key del 82307095
就可以刪除
1 | /etc/apt/trusted.gpg |
解決Unmet dependencies問題
用
dpkg -P package-name
來移除有問題的套件,他會顯示不能移除的原因,然後依序移除即可直接用dpkg安裝套件,如果有缺少的相依套件,之後使用apt install就會顯示
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
錯誤,必須要手動解決相依性問提
apt install使用local repo
1 | Quick instructions to create a trivial local archive with apt-ftparchive |
刪除apt gpg key 和repo
https://itslinuxfoss.com/delete-repository-and-gpg-key-ubuntu/#2
查看套件版本
dpkg-query -W tensorrt
用apt 查看可安裝的版本
apt-cache policy <package name>
例如
1 | $ apt-cache policy gparted |
安裝指定版本sudo apt-get install <package name>=<version>
例如上面的例子
1 | $ sudo apt-get install gparted=0.16.1-1 |