Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

[SOLVED]:cannot open'.git/FETCH_HEAD': Permission denied git

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
Chris1969
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Sun Dec 31, 2017 12:55 pm
Location: switzerland

[SOLVED]:cannot open'.git/FETCH_HEAD': Permission denied git

  • Quote

Post by Chris1969 » Mon Mar 30, 2026 10:23 am

- i have a more than 15 year old system
- about 6 months ago I switched from a multlilib profile to a hardened-gnome-split-usr
- also recently I switched to git syncing

Only thing I still dislike and cannot proceed on is the size of my root partition: it is at 44 GB and I cannot find the reason (/distfiles and /packages are a lvm volume and mounted to /usr/portage).
My plan was to ask for some help from the forum on evaluating the reason for the big amount of data in my root partition, which I should have done... Now I messed it up:

Yesterday I deleted all files in /usr/portage except the folders /distfiles and /packages (I verified that that time stamp of files were much older than ones in /var/db/ , so I assumed I could delete):

- some information on my profile must have been in this directory, as it disappeared after the deletion
- I recreated the profile, which worked
- all repositories sync still successfully with git except for the main one, which produces the following error:[/list]
/usr/bin/git fetch origin --depth 1
error: cannot open '.git/FETCH_HEAD': Permission denied
git fetch error in /var/db/repos/gentoo
* Copying old database to /var/cache/eix/previous.eix
* Running eix-updat
/usr/bin/git fetch origin --depth 1
error: cannot open '.git/FETCH_HEAD': Permission denied
!!! git fetch error in /var/db/repos/gentoo
* Copying old database to /var/cache/eix/previous.eix
* Running eix-update
I am looking for help on a strategy how to best analyze and fix this problem
I have no idea howto proceed
I really would appreciate any guidance
Last edited by Chris1969 on Tue Mar 31, 2026 3:37 pm, edited 2 times in total.
Top
Banana
Moderator
Moderator
User avatar
Posts: 2374
Joined: Fri May 21, 2004 12:02 pm
Location: Germany
Contact:
Contact Banana
Website

  • Quote

Post by Banana » Mon Mar 30, 2026 10:31 am

It may be this: https://www.gentoo.org/support/news-ite ... moval.html

But I'm not sure since something else could also be broken.
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56077
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Mar 30, 2026 10:45 am

Chris1969,

You mention an old system with the main repo at /usr/portage
The default repo location changed many years ago to /var/db/repos/gentoo which git is trying to fetch to. Does that exist on your system?
The default can be changed in /etc/portage/repos.../
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Chris1969
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Sun Dec 31, 2017 12:55 pm
Location: switzerland

  • Quote

Post by Chris1969 » Mon Mar 30, 2026 12:17 pm

NeddySeagoon wrote:Chris1969,

You mention an old system with the main repo at /usr/portage
The default repo location changed many years ago to /var/db/repos/gentoo which git is trying to fetch to. Does that exist on your system?
The default can be changed in /etc/portage/repos.../

Yes, /var/db/repos/gentoo exists
Top
grknight
Retired Dev
Retired Dev
Posts: 2556
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Mon Mar 30, 2026 12:19 pm

Please show your emerge --info
Top
Chris1969
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Sun Dec 31, 2017 12:55 pm
Location: switzerland

  • Quote

Post by Chris1969 » Mon Mar 30, 2026 12:25 pm

Banana wrote:It may be this: https://www.gentoo.org/support/news-ite ... moval.html

But I'm not sure since something else could also be broken.
This one should not apply, as I started using git sync after this news message " 2025-11-01 Portage to verify git-synced ::gentoo per default"
Top
Chris1969
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Sun Dec 31, 2017 12:55 pm
Location: switzerland

  • Quote

Post by Chris1969 » Mon Mar 30, 2026 12:28 pm

grknight wrote:Please show your emerge --info
emerge --info
Portage 3.0.77 (python 3.14.2-final-0, default/linux/amd64/23.0/hardened, gcc-15, glibc-2.42-r5, 6.18.18-gentoo x86_64)
=================================================================
System uname: Linux-6.18.18-gentoo-x86_64-AMD_Ryzen_5_1600_Six-Core_Processor-with-glibc2.42
KiB Mem: 32807772 total, 25242340 free
KiB Swap: 4194300 total, 4194300 free
Timestamp of repository gentoo: Sun, 29 Mar 2026 16:16:00 +0000
Head commit of repository gentoo: 54e51b2b782864c47d52bb5a7d0293c008fcb4ab

Head commit of repository jgenco: da445184e600b7dc438694fee1ea905f9bd4d998

Timestamp of repository sage-on-gentoo: Fri, 31 Oct 2025 23:33:38 +0000
Head commit of repository sage-on-gentoo: 8f18026909371fb395ce5ae696c808fda96bef79

Head commit of repository science: 5cfe936b3066f6d2c46de4cf176a84e67846ef8b

sh bash 5.3_p9
ld GNU ld (Gentoo 2.46.0 p1) 2.46.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-misc/pax-utils: 1.3.10::gentoo
app-shells/bash: 5.3_p9::gentoo
dev-build/autoconf: 2.13-r8::gentoo, 2.72-r6::gentoo
dev-build/automake: 1.18.1::gentoo
dev-build/cmake: 4.1.4::gentoo
dev-build/libtool: 2.5.4::gentoo
dev-build/make: 4.4.1-r102::gentoo
dev-build/meson: 1.9.2::gentoo
dev-java/java-config: 2.3.4::gentoo
dev-lang/perl: 5.42.0-r1::gentoo
dev-lang/python: 3.13.11::gentoo, 3.14.2::gentoo
dev-lang/rust-bin: 1.89.0::gentoo, 1.91.0::gentoo, 1.92.0::gentoo
llvm-core/clang: 21.1.8::gentoo, 22.1.0-r2::gentoo
llvm-core/lld: 21.1.8::gentoo, 22.1.0::gentoo
llvm-core/llvm: 21.1.8::gentoo, 22.1.0-r2::gentoo
sys-apps/baselayout: 2.18::gentoo
sys-apps/openrc: 0.63-r1::gentoo
sys-apps/sandbox: 2.46::gentoo
sys-devel/binutils: 2.46.0::gentoo
sys-devel/binutils-config: 5.6::gentoo
sys-devel/gcc: 15.2.1_p20260214::gentoo
sys-devel/gcc-config: 2.12.2::gentoo
sys-kernel/linux-headers: 6.18::gentoo (virtual/os-headers)
sys-libs/glibc: 2.42-r5::gentoo
Repositories:

gentoo
location: /var/db/repos/gentoo
sync-type: git
sync-uri: https://github.com/gentoo-mirror/gentoo
priority: -1000
volatile: False
sync-git-verify-commit-signature: true

jgenco
location: /var/db/repos/jgenco
sync-type: git
sync-uri: https://github.com/jgenco/jgenco-overlay
masters: gentoo
volatile: False

local
location: /var/db/repos/local
masters: gentoo
volatile: False

sage-on-gentoo
location: /var/db/repos/sage-on-gentoo
sync-type: git
sync-uri: https://github.com/gentoo-mirror/sage-on-gentoo.git
masters: gentoo
volatile: False

science
location: /var/db/repos/science
sync-type: git
sync-uri: https://anongit.gentoo.org/git/proj/sci.git
masters: gentoo
volatile: False

Binary Repositories:

binhost
location: /var/cache/binhost/binhost
priority: 9999
sync-uri: https://www.mirrorservice.org/sites/dis ... /x86-64-v3
verify-signature: None

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE dlj-1.1 PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=znver1"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=znver1"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=" --keep-going --autounmask-backtrack=y"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live compress-index config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_CH.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
LINGUAS="de_CH de en"
MAKEOPTS="-j12 -l13"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="bzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
SHELL="/bin/bash"
USE="R X a52 aac acl acpi airplay alsa amd64 autoipd avahi avif bash-completion bluetooth branding bzip2 cairo caps cdb cdda cddb cdr cdrom cdrtools cdsound cet clamdtop clang cleartype_hinting cli colord compiler-rt corefonts crypt cups dbus declarative device-mapper dri dts duktape dv dvb dvd dvdr eds elogind encode evo exif extensions fat fax ffmpeg ffmpegsource fftw filecaps flac fontconfig frei0r gd gdbm gdk-pixbuf gif glib glut gnome gnome-keyring gnome-online-accounts gnome-shell gnuplot gnutls googledrive gphoto2 gpm gptfdisk graphicsmagick grub gs gsl gstreamer gtk gtk4 gui hardened hddtemp heif hwaccel iconv icu id3tag inkjar interlaced introspection ipv6 iscsi jpeg jpegxl kdrive keyring lastfm lcms libnotify libtirpc lightning llvm-libunwind lm_sensors lvm lzma lzo mad mdnsresponder-compat melt minizip mjpeg mng mp3 mp4 mpeg mpeg2 mpi mtp multilib musicbrainz mysql mysqli nautilus ncurses networkmanager new-login nfs nfsv4 nfsv41 nls nsplugin ntfs ntfsprogs ocr octave ogg opencl opengl openh264 openmp pam pango parted pci pcntl pcre pdf pdfannotextractor pdfimport perl pic pie pipewire pmount png policykit postscript ppds pulseaudio pvr qemu qml qt6 quicktime radio rar raw readline realtime rtc rtf sasl scanner science screencast script scripts sdl seccomp secure-delete slang sound spell spice split-usr sql ssh ssl ssp startup-notification subtitles svg system-av1 system-cairo system-ffmpeg system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-llvm system-mitkrb5 system-png system-qemu system-sqlite test-rust theora tiff tls tls-heartbeat tracker truetype udev udisks unicode upnp upower usb usbredir v4l v4l2 vaapi vcd vde vdpau virgl virt-network virtfs vorbis vpx vtv vulkan wayland webdav webp wma wmf wxwidgets x264 x265 xattr xcb xcomposite xfce xfs xft xml xtpax xv zip zlib" ABI_X86="64" ADA_TARGET="gcc_15" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="ptp2 pentax" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oncore skytraq superstar2 tsip tripmate tnt" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="mouse evdev keyboard" KERNEL="linux" L10N="de-CH-1996 de en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LLVM_TARGETS="AMDGPU X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-3" POSTGRES_TARGETS="postgres17" PYTHON_SINGLE_TARGET="python3_13" PYTHON_TARGETS="python3_13 python3_14" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby32 ruby33" VIDEO_CARDS="vesa v4l fbdev amdgpu radeonsi qxl" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Top
grknight
Retired Dev
Retired Dev
Posts: 2556
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Mon Mar 30, 2026 12:38 pm

Delete /var/db/repos/gentoo and recreate it with a sync. Create the directory after delete with permissions for the portage user to own it.
Top
Chris1969
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Sun Dec 31, 2017 12:55 pm
Location: switzerland

  • Quote

Post by Chris1969 » Mon Mar 30, 2026 12:51 pm

grknight wrote:Delete /var/db/repos/gentoo and recreate it with a sync. Create the directory after delete with permissions for the portage user to own it.
I Did as you mentionend and everything is fine again!
Thanks
Top
Post Reply

9 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic