Cannot SysPrep Machine due to “Package was install for a user”

Recently I was trying to SysPrep a machine ready for imaging , however I got the below

The app was : cannot remove 46928bounde.EclipseManager_2.1.0.21_neutral__a5h4egax66k6y becuase user does not have it installed

I removed all the user profiles on this PC which fixed the issue.

I then had this issue on another computer specifically Facebook_Facebook. Clearing the profile did not fix it. I had to run the below commands to reset the AppRepository Database on the mac

Stop-Service -Name "StateRepository" -Force
takeown /F C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Deployment.srd
takeown /F C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Machine.srd
Rename-Item C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Deployment.srd C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Deployment_corrupted.srd -Force
Rename-Item C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Machine.srd C:\ProgramData\Microsoft\Windows\AppRepository\StateRepository-Machine_corrupted.srd -Force
Start-Service -Name "StateRepository"
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...