13

Tried to do sudo apt-get update, get this response every time I run it:

Get:1 http://repo.radeon.com/rocm/apt/debian xenial InRelease [1814 B]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Err:1 http://repo.radeon.com/rocm/apt/debian xenial InRelease
  Couldn't create temporary file /tmp/apt.conf.RpjjUo for passing config to apt-key
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
  Couldn't create temporary file /tmp/apt.conf.IvhgJr for passing config to apt-key
Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Err:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  Couldn't create temporary file /tmp/apt.conf.F98B6M for passing config to apt-key
Get:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Err:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
  Couldn't create temporary file /tmp/apt.conf.WWtE1d for passing config to apt-key
Get:3 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Err:3 http://archive.ubuntu.com/ubuntu bionic InRelease
  Couldn't create temporary file /tmp/apt.conf.TP8dgO for passing config to apt-key
Reading package lists... Done
W: GPG error: http://repo.radeon.com/rocm/apt/debian xenial InRelease: Couldn't create temporary file /tmp/apt.conf.RpjjUo for passing config to apt-key
E: The repository 'http://repo.radeon.com/rocm/apt/debian xenial InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://security.ubuntu.com/ubuntu bionic-security InRelease: Couldn't create temporary file /tmp/apt.conf.IvhgJr for passing config to apt-key
E: The repository 'http://security.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu bionic-updates InRelease: Couldn't create temporary file /tmp/apt.conf.F98B6M for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu bionic-backports InRelease: Couldn't create temporary file /tmp/apt.conf.WWtE1d for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu bionic-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu bionic InRelease: Couldn't create temporary file /tmp/apt.conf.TP8dgO for passing config to apt-key
E: The repository 'http://archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Tried sudo apt-get clean, nothing happened. sudo apt-get upgrade states that there is nothing that needs to be upgraded. sudo apt-get check doesn't find anything either.

Using Ubuntu on Windows 10.

6
  • To me this looks like a problem with tmp. Can you touch /tmp/test? – LAROmega Oct 28 '19 at 0:00
  • @LAROmega I got touch: cannot touch '/tmp/test': Permission denied – Coloradohusky Oct 29 '19 at 23:51
  • Make sure /tmp exists. Not sure why it wouldn't but the Ubuntu Linux Subsystem should have it has part of root's file system. – LAROmega Oct 30 '19 at 0:18
  • @LAROmega It exists – Coloradohusky Oct 30 '19 at 0:42
  • 2
    i had faced same issue in docker , a quick solution would be to do sudo chmod 777 /tmp and it worked for me – niths4u Feb 3 '20 at 4:29
20

You probably changed the file permissions on your /tmp folder, check with

ls -lad /tmp

The normal settings for /tmp are 1777, which ls shows as drwxrwxrwt. That is: wide open, except that only the owner of a file can remove it (that's what this extra t bit means for a directory).

If the settings are wrong, you can restore them with:

chmod 1777 /tmp

I would recommend rebooting the machine after making this change.

If you cannot reboot, check the answers here: https://unix.stackexchange.com/a/71625/20661

NOTE: also check /var/tmp the same way, maybe you have the same error there

0
1

For me, I was using a Docker container and had mounted a directory to /tmp in the container, which was causing the conflict. I removed the mounted directory to /tmp and that allowed apt update to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.