安装NVIDIA Jetpack/DriveInstall后,apt-get 报错无arm64源

网上的解决方案大多是删除已经安装的arm64包,然后执行dpkg --remove-architecture arm64,但是错误在下次刷机后依然会出现

使用NVIDIA Jetson TX1/TX2,Drive PX2 的同学在刷完机以后,宿主机的apt-get无法正确使用。原因是自带的刷机包(Jetpack/DriveInstall)给系统安装了arm64的软件包,报错如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 Err:29 http://archive.ubuntu.com/ubuntu xenial/main arm64 Packages
404 Not Found [IP: 91.189.88.161 80]
Ign:37 http://archive.ubuntu.com/ubuntu xenial/universe arm64 Packages
Ign:40 http://archive.ubuntu.com/ubuntu xenial/multiverse arm64 Packages
Err:46 http://archive.ubuntu.com/ubuntu xenial-updates/main arm64 Packages
404 Not Found [IP: 91.189.88.161 80]
Ign:56 http://archive.ubuntu.com/ubuntu xenial-updates/universe arm64 Packages
Ign:62 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse arm64 Packages
Err:68 http://archive.ubuntu.com/ubuntu xenial-backports/main arm64 Packages
404 Not Found [IP: 91.189.88.161 80]
Ign:75 http://archive.ubuntu.com/ubuntu xenial-backports/universe arm64 Packages
Err:83 http://archive.ubuntu.com/ubuntu xenial-security/main arm64 Packages
404 Not Found [IP: 91.189.88.161 80]
Ign:93 http://archive.ubuntu.com/ubuntu xenial-security/universe arm64 Packages
Ign:99 http://archive.ubuntu.com/ubuntu xenial-security/multiverse arm64 Packages

正确的解决方案为,修改/etc/apt/source.list在每一行的debhttp://×××中间加入[arch=amd64,i386],修改后的source.list文件如下(仅供参考,请按需修改):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# deb cdrom:[Xubuntu 16.04.4 LTS _Xenial Xerus_ - Release amd64 (20180228)]/ xenial main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial universe
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universe
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial multiverse
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb [arch=amd64,i386] http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://archive.ubuntu.com/ubuntu xenial universe
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu xenial universe
# deb-src http://archive.ubuntu.com/ubuntu xenial universe