[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] GuestD0932:
$ pm list packages -f -u [I]com.package.you.miss[/I]
package [I]/path/to/package.apk[/I]=[I]com.package.you.miss[/I]
$ pm install -r --user 0 [I]/path/to/package.apk[/I]
Success # hopefully

This might help for most of the pre-installed packages.

EDIT:

I've tested this procedure with my Xperia

XZ1

(47.1.A.12.205) on some packages and got the following results.

Failure/1:

Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/...apk: META-INF/... indicates /data/app/...apk is signed using APK Signature Scheme v2, but no such signature was found. Signature stripped?]

Failure/2:

Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/...: Package /data/app/...apk code is missing]

com.sonymobile.entrance → Success

com.sonymobile.advancedlogging → Failure/2

com.sonymobile.anondata → Failure/2

com.android.chrome → Failure/1

com.sonymobile.demoappchecker → Success

com.google.android.apps.tachyon → Failure/1

com.android.egg → Failure/2

com.sonymobile.exchange → Success

com.sonymobile.android.externalkeyboardjp → Success

com.android.facelock → Success

com.sonymobile.googleanalyticsproxy → Failure/2

com.sonymobile.music.googlelyricsplugin → Success

com.google.android.printservice.recommendation → Success

com.google.android.tts → Failure/1

com.sonyericsson.idd.agent → Failure/2

com.sonymobile.idd.permission.application_certificate → Success

com.sonymobile.sso → Failure/2

com.android.wallpaper.livepicker → Failure/2

com.android.providers.partnerbookmarks → Success

com.sonymobile.secureclockservice → Failure/2

com.sonymobile.email → Success

com.sonymobile.moviecreator.rmm → Failure/1

com.sonymobile.pobox → Failure/1

com.sonymobile.susrescheck → Failure/2

com.sonymobile.synchub → Failure/1

com.sonyericsson.tetherentitlementcheck → Failure/2

com.sonymobile.themes.sou.cid18.black → Success

com.sonymobile.themes.sou.cid19.silver → Success

com.sonymobile.themes.sou.cid20.blue → Success

com.sonymobile.themes.sou.cid21.pink → Success

com.sonymobile.music.wikipediaplugin → Success

com.sonymobile.xperiatransfermobile → Success

com.google.android.youtube → Failure/1

com.sonymobile.music.youtubekaraokeplugin → Success

com.sonymobile.music.youtubeplugin → Success

com.amazon.kindle → Success

com.amazon.mShop.android.shopping → Success

com.facebook.appmanager → Success

com.facebook.katana → Success

com.s.antivirus → Success

com.sonyericsson.xhs → Success

com.sonymobile.deqp → Failure/2

com.sonymobile.xperialounge.services → Success

com.spotify.music → Success

com.sonymobile.deviceconfigtool → Success

com.sonymobile.updatecenter.config.autoinstall → Success

com.sonymobile.updatecenter.config.latecmz → Success

com.sonymobile.phoneusage → Failure/2

com.sonymobile.pip → Success

com.google.android.marvin.talkback → Success

com.sony.tvsideview.videoph → Success

com.sonymobile.xperiaweather → Success

com.android.cts.ctsshim → Failure/2

com.sonyericsson.crashmonitor → Failure/2

com.sonymobile.crashmonitor.system → Failure/2

com.google.android.syncadapters.contacts → Success

com.sonymobile.rcahandler → Failure/2

com.sonymobile.prediction → Failure/2

com.sonymobile.xperiaservices → Success

com.sonymobile.xperiaxlivewallpaper → Success

com.sonymobile.infoapp → Failure/1

com.sonymobile.support → Success

com.sonymobile.fota.service → Failure/2

com.sonyericsson.android.addoncamera.artfilter → Failure/1

com.sonymobile.cameracommon.wearablebridge → Success

com.sonymobile.advancedwidget.clock → Success

com.google.android.configupdater → Success

com.sonymobile.android.contacts → Failure/2

com.sonymobile.coverapp2 → Success

com.android.cts.priv.ctsshim → Failure/1

com.android.documentsui → Failure/2

com.sonymobile.getset → Success

com.sonymobile.getset.priv → Success

com.google.android.backuptransport → Success

com.google.android.feedback → Success

com.google.android.onetimeinitializer → Success

com.google.android.partnersetup → Success

com.google.android.gsf → Success

com.android.hotwordenrollment.okgoogle → Failure/2

com.android.managedprovisioning → Failure/2

com.sonyericsson.android.omacp → Failure/2

com.google.android.apps.work.oobconfig → Success

com.android.vending → Success

com.sonymobile.simlock.service → Failure/2

com.sonyericsson.setupwizard → Failure/2

com.sonyericsson.organizer → Success

com.sonyericsson.providers.cnap → Failure/2

com.android.providers.contacts → Failure/2

com.sonyericsson.music → Failure/1

com.sonyericsson.photoeditor → Failure/1

com.google.android.setupwizard → Success

com.sonymobile.moviecreator → Success

com.sonymobile.android.addoncamera.soundphoto → Failure/1

com.sonyericsson.startupflagservice → Failure/2

com.android.apps.tag → Failure/2

com.sonyericsson.updatecenter → Success

com.google.android.googlequicksearchbox → Success

com.sonyericsson.album → Failure/1

com.sonymobile.assist.persistent → Success

com.sonymobile.assist → Success

com.facebook.services → Success

com.facebook.system → Success

com.sonymobile.retaildemo → Success

com.sonyericsson.suquashi.soundpicker → Success

com.sonyericsson.textinput.chinese → Failure/1

com.android.partnerbrowsercustomizations.chromeHomepage → Success

I don't understand at the moment why it doesn't work with all packages. So to prevent many factory resets, I would recommend creating a new user, looking up its ID, and trying to disable/uninstall the packages for it. Your main user account will be unaffected from that.

$ pm create-user [I]test[/I]
Success: created user id [I]10
[/I]$ pm list users # just to verify that worked
Users:
UserInfo{0:[I]Hallmund Gautisson[/I]:13} running
UserInfo{[I]10[/I]:[I]test[/I]:0}
$ pm disable-user --user [I]10[/I] [I]com.package.to.test[/I] [COLOR="Green"]# this should also be safe if it's done with your main user account (0)[/COLOR]
Package [I]com.package.to.test[/I] new state: disabled-user
$ pm enable --user [I]10[/I] [I]com.package.to.test[/I] [COLOR="Green"]# to undo the disable command, works reliable[/COLOR]
Package [I]com.package.to.test[/I] new state: enabled
$ pm uninstall -k --user [I]10[/I] [I]com.package.to.test[/I] [COLOR="Red"]# this could force you to perform a factory reset when applied to your main user account (0)[/COLOR]
$ pm list packages -f -u [I]com.package.to.test[/I]
package [I]/path/to/package.apk[/I]=[I]com.package.to.test[/I]
$ pm install -r --user [I]10[/I] [I]/path/to/package.apk[/I] [COLOR="red"]# to undo the uninstall command, works flaky[/COLOR]
Success or one of the above errors