Can the Play Store (in /system/priv-app/) be reinstalled with a newer version?

Tapping on the build number in the Play Store doesn’t really update it anymore on my device; I have no idea why. I’ve been trying to sideload the apk which just installs the newer version into /data/app/ but after several reboots i still don’t see the newer version.

So yes, is it possible that I just delete the one from the /system/priv-app/ and push the newer version in it?

Strangely, other Google apps that didn’t come preinstalled just fails to install through the rom’s old Play Store (version 5.5.12)and just comes up with a “-504” error. The same happens when trying to update preinstalled ones.

My phone is on stock Android 5.0 from the manufacturer rooted with SuperSU 2.82.

Why do write attempts to /system/priv-app cause /system to switch to read-only?

I’m trying to write files to the /system/priv-app directory. I boot into recovery (TWRP) and run adb shell.

~ # mount /system ~ # mount rootfs on / type rootfs (rw,seclabel) ... /dev/block/mmcblkXXXX on /system type ext4 (rw,seclabel,relatime,data=ordered) 

I can then run:

~ # mkdir /system/tmp ~ # touch /system/tmp/test 

This works fine: I have no problem modifying /system. (I can also delete things from /system/priv-app.) But if I then try to write to /system/priv-app I get the following:

~ # mkdir /system/priv-app/test mkdir: can't create directory '/system/priv-app/test': Read-only file system ~ # mount rootfs on / type rootfs (rw,seclabel) ... /dev/block/mmcblkXXXX on /system type ext4 (ro,seclabel,relatime,data=ordered) 

Now /system is suddenly mounted read-only! Permissions and ownership are identical in /system and /system/priv-app and I’m running as root.

~ # ls -al / ... drwxr-xr-x   18 root     root          4096 Nov 25 07:32 system ~ # ls -al /system ... drwxr-xr-x   59 root     root          4096 Aug  5  1972 priv-app 

While in TWRP, SELinux is set to permissive:

~ # getenforce Permissive 

I’m running Lineage OS 14.1 (Android Nougat) on a Moto G 2015 (aka Moto G3). It’s rooted with the official Lineage su addon. I also tried Magisk and get the same result.

I’ve run out of ideas, and I can’t figure out the right search terms, because I’ve tried a ton of things and have not turned anything up.

How can I enable writing to /system/priv-app?