1) Login as user
2) mkdir ~/repos && cd ~/repos
3) git clone https://github.com/gentoo/gentoo.git
4) cd net-misc/wget
5) repoman -d full
You will get the error message:
> RepoMan scours the neighborhood...
> *** the local copy of metadata.dtd needs to be refetched, doing that now
> Repoman: Need user access
The problem is that repoman wants to use a current metadata.dtd from system's portage tree... but the user running repoman isn't allowed to update /usr/portage/distfiles/metadata.dtd...
An error message telling you need _user_ access doesn't make sense for me.
I just hit this today as well. I had blown away my distfiles directory to free up some space, then got a traceback:
*** the local copy of metadata.xsd needs to be refetched, doing that now
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.4/repoman", line 44, in <module>
File "/usr/lib64/python3.4/site-packages/repoman/main.py", line 117, in repoman_main
vcs_settings, mydir, env)
File "/usr/lib64/python3.4/site-packages/repoman/scanner.py", line 191, in __init__
File "/usr/lib64/python3.4/site-packages/repoman/metadata.py", line 127, in get_metadata_xsd
File "/usr/lib64/python3.4/site-packages/repoman/metadata.py", line 78, in fetch_metadata_xsd
File "/usr/lib64/python3.4/tempfile.py", line 278, in mkstemp
return _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/lib64/python3.4/tempfile.py", line 207, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/var/portage/distfiles/metadata.xsd.sk5yg0dc'
after sudo mkdir /var/portage/distfiles/ && sudo chown -R portage:portage /var/portage/distfiles/, I reran it, and now get:
Repoman: Need user access
(In reply to Austin English from comment #1)
> after sudo mkdir /var/portage/distfiles/ && sudo chown -R portage:portage
> /var/portage/distfiles/, I reran it, and now get:
> Repoman: Need user access
Ah, permissions were 755, changed to 775 so portage group had write access, now it's working.
The error message could still be more helpful, though.
Does this mean that the solution to this error is to add user to the portage group? Wouldn't this be somewhat unsafe?
In https://wiki.gentoo.org/wiki/Repoman#.22Need_user_access.22 it is said that another option is to adjust filesystem permissions. Does this mean making the metadata.dtd file writeable by user? But if so, on my system the file is located in /usr/portage/metadata/dtd/metadata.dtd and is owned by root:
% ls -ld /usr/portage/metadata/dtd/metadata.dtd
-rw-r--r-- 1 root root 4421 Jan 9 12:09 /usr/portage/metadata/dtd/metadata.dtd
% ls -ld /usr/portage/metadata/dtd/
drwxr-xr-x 2 root root 4096 Feb 12 15:55 /usr/portage/metadata/dtd/
% ls -ld /usr/portage/metadata/
drwxr-xr-x 9 root root 4096 Feb 12 15:55 /usr/portage/metadata/
So adding user to portage would be of no help!
My distfiles are in /usr/portage/distfiles and portage has group ownership there:
% ls -ld /usr/portage/distfiles
drwxrwxr-x 3 root portage 217088 Feb 13 03:40 /usr/portage/distfiles
But, unlike comment 0, there is no metadata.dtd file in there:
% ls -l /usr/portage/distfiles/metadata.dtd
ls: cannot access '/usr/portage/distfiles/metadata.dtd': No such file or directory
(In reply to orionbelt2 from comment #3)
You can set DISTDIR variable to something writable by user:
DISTDIR=/tmp repoman ...
(In reply to Alexander Tsoy from comment #4)
> (In reply to orionbelt2 from comment #3)
> You can set DISTDIR variable to something writable by user:
> DISTDIR=/tmp repoman ...
Thanks, that worked!