Docker内执行 apt-get update 报错:Couldn't create temporary file /tmp/apt.conf.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
apt-get update
Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease [1581 B]
Err:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease
Couldn't create temporary file /tmp/apt.conf.u0DRga for passing config to apt-key
Get:4 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Couldn't create temporary file /tmp/apt.conf.xzh9cs for passing config to apt-key
Err:4 http://security.ubuntu.com/ubuntu bionic-security InRelease
Couldn't create temporary file /tmp/apt.conf.N2fnMq for passing config to apt-key
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Couldn't create temporary file /tmp/apt.conf.JreIfD for passing config to apt-key
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [83.3 kB]
Err:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Couldn't create temporary file /tmp/apt.conf.QsK4tP for passing config to apt-key
Reading package lists... Done
W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: Couldn't create temporary file /tmp/apt.conf.u0DR ga for passing config to apt-key
E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
....
  • 解决方法
    1
    2
    chmod 1777 /tmp
    apt-get update