First emerge --sync with portage-2.3.43 leaves new/modified files owned by root, which causes hardlinking to fail on a subsequent run, with lots of these errors: rsync: link "/mnt/media/portage/.tmp-unverified-download-quarantine/x11-terms/mlterm/mlterm-3.8.6.ebuild" => /mnt/media/portage/x11-terms/mlterm/mlterm-3.8.6.ebuild failed: Operation not permitted (1) I've just performed a sync (having first reset all perms in $PORTDIR to portage:portage) and the following files are now root-owned. (Last sync was a few hours ago.) # find /mnt/media/portage/ -user root /mnt/media/portage/dev-python/Manifest.gz /mnt/media/portage/dev-python/django-tastypie/django-tastypie-0.13.3-r1.ebuild /mnt/media/portage/dev-python/django-tastypie/Manifest /mnt/media/portage/dev-python/lit/lit-6.0.1.ebuild /mnt/media/portage/dev-python/lit/Manifest /mnt/media/portage/dev-python/django/django-1.8.19.ebuild /mnt/media/portage/dev-python/django/Manifest /mnt/media/portage/metadata/news/timestamp.chk /mnt/media/portage/metadata/news/Manifest /mnt/media/portage/metadata/md5-cache/dev-python/django-tastypie-0.13.3-r1 /mnt/media/portage/metadata/md5-cache/dev-python/lit-6.0.1 /mnt/media/portage/metadata/md5-cache/dev-python/Manifest.gz /mnt/media/portage/metadata/md5-cache/dev-python/django-1.8.19 /mnt/media/portage/metadata/md5-cache/Manifest.gz /mnt/media/portage/metadata/md5-cache/dev-ruby/Manifest.gz /mnt/media/portage/metadata/md5-cache/app-emacs/Manifest.gz /mnt/media/portage/metadata/md5-cache/app-emacs/ebuild-mode-1.44 /mnt/media/portage/metadata/md5-cache/sys-libs/compiler-rt-sanitizers-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-libs/compiler-rt-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-libs/llvm-libunwind-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-libs/Manifest.gz /mnt/media/portage/metadata/md5-cache/sys-libs/libcxx-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-libs/libcxxabi-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-libs/libomp-6.0.1 /mnt/media/portage/metadata/md5-cache/dev-vcs/Manifest.gz /mnt/media/portage/metadata/md5-cache/dev-vcs/mercurial-4.6.2 /mnt/media/portage/metadata/md5-cache/sys-devel/Manifest.gz /mnt/media/portage/metadata/md5-cache/sys-devel/llvmgold-6 /mnt/media/portage/metadata/md5-cache/sys-devel/clang-common-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-devel/clang-runtime-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-devel/llvm-common-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-devel/clang-6.0.1 /mnt/media/portage/metadata/md5-cache/sys-devel/llvm-6.0.1 /mnt/media/portage/metadata/timestamp /mnt/media/portage/metadata/Manifest.gz /mnt/media/portage/metadata/timestamp.chk /mnt/media/portage/metadata/timestamp.commit /mnt/media/portage/metadata/xml-schema/timestamp.chk /mnt/media/portage/metadata/glsa/timestamp.chk /mnt/media/portage/metadata/glsa/Manifest /mnt/media/portage/metadata/timestamp.x /mnt/media/portage/metadata/dtd/timestamp.chk /mnt/media/portage/dev-ruby/builder/Manifest /mnt/media/portage/dev-ruby/Manifest.gz /mnt/media/portage/dev-ruby/rdiscount/Manifest /mnt/media/portage/dev-ruby/mustache/Manifest /mnt/media/portage/dev-ruby/syntax/Manifest /mnt/media/portage/dev-ruby/hoe-seattlerb/Manifest /mnt/media/portage/app-emacs/Manifest.gz /mnt/media/portage/app-emacs/ebuild-mode/ebuild-mode-1.44.ebuild /mnt/media/portage/app-emacs/ebuild-mode/Manifest /mnt/media/portage/sys-libs/compiler-rt/compiler-rt-6.0.1.ebuild /mnt/media/portage/sys-libs/compiler-rt/Manifest /mnt/media/portage/sys-libs/llvm-libunwind/Manifest /mnt/media/portage/sys-libs/llvm-libunwind/llvm-libunwind-6.0.1.ebuild /mnt/media/portage/sys-libs/Manifest.gz /mnt/media/portage/sys-libs/compiler-rt-sanitizers/Manifest /mnt/media/portage/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-6.0.1.ebuild /mnt/media/portage/sys-libs/libcxx/libcxx-6.0.1.ebuild /mnt/media/portage/sys-libs/libcxx/Manifest /mnt/media/portage/sys-libs/libomp/libomp-6.0.1.ebuild /mnt/media/portage/sys-libs/libomp/Manifest /mnt/media/portage/sys-libs/libcxxabi/libcxxabi-6.0.1.ebuild /mnt/media/portage/sys-libs/libcxxabi/Manifest /mnt/media/portage/dev-vcs/Manifest.gz /mnt/media/portage/dev-vcs/mercurial/mercurial-4.6.2.ebuild /mnt/media/portage/dev-vcs/mercurial/Manifest /mnt/media/portage/sys-devel/llvm/llvm-6.0.1.ebuild /mnt/media/portage/sys-devel/llvm/Manifest /mnt/media/portage/sys-devel/Manifest.gz /mnt/media/portage/sys-devel/llvm-common/llvm-common-6.0.1.ebuild /mnt/media/portage/sys-devel/llvm-common/Manifest /mnt/media/portage/sys-devel/clang-runtime/Manifest /mnt/media/portage/sys-devel/clang-runtime/clang-runtime-6.0.1.ebuild /mnt/media/portage/sys-devel/clang/clang-6.0.1.ebuild /mnt/media/portage/sys-devel/clang/Manifest /mnt/media/portage/sys-devel/llvmgold/llvmgold-6.ebuild /mnt/media/portage/sys-devel/llvmgold/Manifest /mnt/media/portage/sys-devel/clang-common/clang-common-6.0.1.ebuild /mnt/media/portage/sys-devel/clang-common/Manifest /mnt/media/portage/Manifest /mnt/media/portage/Manifest.files.gz emerge --info: Portage 2.3.43 (python 3.5.5-final-0, default/linux/amd64/17.0, gcc-7.3.0, glibc-2.27-r5, 4.17.4-gentoo x86_64) ================================================================= System uname: Linux-4.17.4-gentoo-x86_64-AMD_Turion-tm-_II_Neo_N40L_Dual-Core_Processor-with-gentoo-2.6 KiB Mem: 3893544 total, 624332 free KiB Swap: 6141692 total, 5623768 free Timestamp of repository gentoo: Sun, 22 Jul 2018 19:15:01 +0000 Head commit of repository gentoo: f318a11932b4efaf1d5548e9632618e0b17afb8e sh bash 4.4_p23 ld GNU ld (Gentoo 2.30 p3) 2.30.0 distcc 3.2rc1 x86_64-pc-linux-gnu [disabled] ccache version 3.3.4 [enabled] app-shells/bash: 4.4_p23::gentoo dev-java/java-config: 2.2.0-r4::gentoo dev-lang/perl: 5.26.2::gentoo dev-lang/python: 2.7.15::gentoo, 3.5.5-r1::gentoo dev-util/ccache: 3.3.4-r1::gentoo dev-util/cmake: 3.11.4::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.6::gentoo sys-apps/openrc: 0.38.1::gentoo sys-apps/sandbox: 2.13::gentoo sys-devel/autoconf: 2.13::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.13.4-r2::gentoo, 1.16.1-r1::gentoo sys-devel/binutils: 2.30-r3::gentoo sys-devel/gcc: 7.2.0-r1::gentoo, 7.3.0::gentoo sys-devel/gcc-config: 1.9.1::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r3::gentoo sys-kernel/linux-headers: 4.17::gentoo (virtual/os-headers) sys-libs/glibc: 2.27-r5::gentoo Repositories: gentoo location: /mnt/media/portage sync-type: rsync sync-uri: rsync://rsync.uk.gentoo.org/gentoo-portage priority: -1000 sync-rsync-verify-jobs: 1 sync-rsync-verify-max-age: 24 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: no squeezebox location: /var/lib/layman/squeezebox masters: gentoo priority: 0 x-portage location: /usr/local/portage masters: gentoo priority: 1 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /etc/make.conf /usr/bin/vncserver /usr/lib/X11/xdm/Xsetup_0 /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/hp/hplip.conf /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/mnt/media/cache/distfiles" EMERGE_DEFAULT_OPTS="--nospinner --quiet-build=n --verbose-conflicts" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs ccache distlocks ebuild-locks fail-clean fixlafiles merge-sync multilib-strict news preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.mirrors.ovh.net/gentoo-distfiles/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://mirror.leaseweb.com/gentoo/ http://mirrors.linuxant.fr/distfiles.gentoo.org/ http://mirror.netcologne.de/gentoo/" LANG="en_GB.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LINGUAS="en_GB" MAKEOPTS="-j10 -l2" PKGDIR="/mnt/media/portage/packages" 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" USE="3dnow 3dnowext X509 a52 aac accessibility acl acpi alsa amd64 apache2 bash-completion berkdb bzip2 clamav cli consolekit crypt curl curlwrappers cxx dbm dbus dbx dri dv enca encode exif fam fastcgi fat ffmpeg flac foomaticdb fortran ftp gd gd-external gdbm gnutls gudev hardened hwdb iconv imagemagick imap imlib innodb java javascript jpeg lcms libkms libtirpc libwww lzo mad matroska mdadm minimal mmx mmxext modules mp3 multilib mysql ncurses network nls nptl nsplugin ntfs offensive ogg openmp optimized-qmake pam pcre php png policykit posix raw readline rtmp samba scanner seccomp session sharedmem snmp soap sse sse2 sse4a ssl startup-notification tcpd theora threads tidy tiff tokenizer tordns udev unicode usb vdpau vhosts win32codecs x264 xattr xinetd xmlrpc xsl xv xvid xvmc xz zip zlib" ABI_X86="64" APACHE2_MODULES="access_compat actions alias auth_basic auth_digest authn_core authn_anon authn_dbd authn_dbm authn_default authn_file authz_core authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif slotmem_shm so socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" L10N="en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-3" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby23" SANE_BACKENDS="hp net" USERLAND="GNU" VIDEO_CARDS="radeon r600 vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" Unset: CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Hitting this too, it's preventing some packages from being updated easily
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=e356d53ceb10ee24969ee79766f30e5004395f81 commit e356d53ceb10ee24969ee79766f30e5004395f81 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2018-07-23 19:39:39 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2018-07-23 19:39:39 +0000 RsyncSync: fix _commit_download usersync privileges (bug 661834) Fix the _commit_download to drop privileges for the rsync call, in order to prevent it from creating files owned by root. Fixes: 84822ef7a214 ("rsync: quarantine data prior to verification (bug 660410)") Bug: https://bugs.gentoo.org/661834 lib/portage/sync/modules/rsync/rsync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a11e6079130d61d8d8297215ffea32e2743cbd0 commit 2a11e6079130d61d8d8297215ffea32e2743cbd0 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2018-07-23 20:02:42 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2018-07-23 20:09:18 +0000 sys-apps/portage: revbump to 2.3.43-r1 #661834 - synced files owned by root #661906 - git sync continues despite key refresh failure Bug: https://bugs.gentoo.org/661834 Bug: https://bugs.gentoo.org/661906 Package-Manager: Portage-2.3.43, Repoman-2.3.10 .../portage/{portage-2.3.43.ebuild => portage-2.3.43-r1.ebuild} | 8 ++++++++ 1 file changed, 8 insertions(+)
sys-apps/portage-2.3.43-r1 didn't fix the problem. I changed all the files under portage directory to portage:portage ownership. After emerge sync, files owned by root appear again.
(In reply to email200202 from comment #4) > sys-apps/portage-2.3.43-r1 didn't fix the problem. > > I changed all the files under portage directory to portage:portage > ownership. After emerge sync, files owned by root appear again. Make sure you have FEATURES="usersync" enabled. If that doesn't help, please check if the problem is suppressed by setting "sync-allow-hardlinks = no" in repos.conf. Also please post emerge --info output.
Thanks Zac Medico The portage directory itself was owned by root and I didn't have usersync feature. Now it is working.
*** Bug 663746 has been marked as a duplicate of this bug. ***
Fixed in portage-2.3.43-r1 and later.