LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 07-16-2020, 03:31 AM   #1
pizpower
LQ Newbie
 
Registered: Jul 2020
Posts: 2

Rep: Reputation: Disabled
Unhappy Could not create temporary gpg home directory in (wrong permissions?)


Hello,

Am having an issue when doing apt-get update/upgrade.

errors am having:

Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Err:1 http://archive.ubuntu.com/ubuntu focal InRelease
Could not create temporary gpg home directory in (wrong permissions?)
Get:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Err:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease
Could not create temporary gpg home directory in (wrong permissions?)
Ign:4 http://download.webmin.com/download/repository sarge InRelease
Get:5 http://archive.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Err:3 http://archive.ubuntu.com/ubuntu focal-backports InRelease
Could not create temporary gpg home directory in (wrong permissions?)
Err:5 http://archive.ubuntu.com/ubuntu focal-security InRelease
Could not create temporary gpg home directory in (wrong permissions?)
Get:6 http://download.webmin.com/download/repository sarge Release [16.9 kB]
Get:7 http://download.webmin.com/download/repository sarge Release.gpg [173 B]
Err:7 http://download.webmin.com/download/repository sarge Release.gpg
Could not create temporary gpg home directory in (wrong permissions?)
Fetched 334 kB in 1s (281 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal InRelease: Could not create temporary gpg home directory in (wrong permissions?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal-updates InRelease: Could not create temporary gpg home directory in (wrong permissions?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal-backports InRelease: Could not create temporary gpg home directory in (wrong permissions?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://archive.ubuntu.com/ubuntu focal-security InRelease: Could not create temporary gpg home directory in (wrong permissions?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://download.webmin.com/download/repository sarge Release: Could not create temporary gpg home directory in (wrong permissions?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not create temporary gpg home directory in (wrong permissions?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dis...ates/InRelease Could not create temporary gpg home directory in (wrong permissions?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dis...orts/InRelease Could not create temporary gpg home directory in (wrong permissions?)
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dis...rity/InRelease Could not create temporary gpg home directory in (wrong permissions?)
W: Failed to fetch http://download.webmin.com/download/...ge/Release.gpg Could not create temporary gpg home directory in (wrong permissions?)
W: Some index files failed to download. They have been ignored, or old ones used instead.

---

Permissions:

drwx------ 2 root root 4096 Apr 29 13:05 private-keys-v1.d
-rw------- 1 root root 31803 Apr 29 14:29 pubring.kbx
-rw------- 1 root root 29402 Apr 29 14:29 pubring.kbx~
srwx------ 1 root root 0 Apr 30 14:30 S.gpg-agent
srwx------ 1 root root 0 Apr 30 14:30 S.gpg-agent.browser
srwx------ 1 root root 0 Apr 30 14:30 S.gpg-agent.extra
srwx------ 1 root root 0 Apr 30 14:30 S.gpg-agent.ssh
-rw------- 1 root root 49152 Apr 29 13:05 tofu.db
-rw------- 1 root root 1200 Apr 29 13:11 trustdb.gpg

Can someone help please?

Thanks.
 
Old 07-17-2020, 12:37 PM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Just a potential guess here.

Is your disk out of space?

Because the package manager may be just offering a similar guess as to what I'm saying.

The other thing is did you use sudo to issue the command so that you'd have root privileges? Or is your login already root?

That would be:
Code:
$ sudo apt-get <command>
 
1 members found this post helpful.
Old 07-17-2020, 01:59 PM   #3
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
apt usually works out of /var/cache/apt so check permissions and space there.
 
Old 07-21-2020, 01:57 AM   #4
pizpower
LQ Newbie
 
Registered: Jul 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hello,

sorry for the late reply.

yes am already root.

with regards to space: only 6% in use, I have 274G available space.
 
Old 07-21-2020, 06:58 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I found where the error originates from, it's a shell function inside the apt-key.in script:
Code:
# gpg needs (in different versions more or less) files to function correctly,
# so we give it its own homedir and generate some valid content for it later on
create_gpg_home() {
    # for cases in which we want to cache a homedir due to expensive setup
    if [ -n "$GPGHOMEDIR" ]; then
	return
    fi
    if [ -n "$TMPDIR" ]; then
	# tmpdir is a directory and current user has rwx access to it
	# same tests as in apt-pkg/contrib/fileutl.cc GetTempDir()
	if [ ! -d "$TMPDIR" ] || [ ! -r "$TMPDIR" ] || [ ! -w "$TMPDIR" ] || [ ! -x "$TMPDIR" ]; then
	    unset TMPDIR
	fi
    fi
    GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')"
    CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;"
    trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
    if [ -z "$GPGHOMEDIR" ]; then
	apt_error "Could not create temporary gpg home directory in $TMPDIR (wrong permissions?)"
	exit 28
    fi
    chmod 700 "$GPGHOMEDIR"
}
Wild guess: Your /tmp is not writeable and/or $TMPDIR is not set.
 
Old 07-21-2020, 07:17 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
TMPDIR is definitely not set, this would explain lack of the directory name in the error message:
Code:
Could not create temporary gpg home directory in (wrong permissions?)
But /tmp not being writable would manifest in much more than only apt-get failure. I'd say the partition containing /tmp being out of space as hinted by rtmistler above is the most probable cause.

@OP. Try to create a temporary directory by hand with
Code:
mktemp -d --tmpdir
What message do you get?

Last edited by shruggy; 07-21-2020 at 07:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 10:06 AM
[SOLVED] gpg: WARNING: unsafe permissions on configuration file `/home/b/.gnupg/options' gpg: widda Mandriva 9 07-30-2018 07:49 AM
"cannot create temporary directory for the root file system: No space left on device", but df-h says home and root are 77% and inodes are OK roberto32 Linux - General 3 05-27-2018 07:34 AM
Login Error- Could not chdir to home directory /home/UserID: No such file or directory abhi_jais Linux - Newbie 1 03-24-2018 12:01 PM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 09:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 02:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration