Sharepoint - Error copying temporary solution file to solutions gallery

The problem was my profile. It was kind of corrupt.

Somehow whenever I logged-in on my SharePoint 2013 server, windows could not find my profile and used a temperary profile.

Removing this profile and restarting the server solved the problem.

Removing temperary profiles describes the following various steps to solve the problems

How to fix it if you see those nasty “c:\users\TEMP” folders?

  1. Stop the relevant application pools
  2. Stop the IIS Admin Service (in services.msc)
  3. See that the TEMP folders are gone in c:\users

if the TEMP folders are not disappearing, or you are still getting a temporary profile, you can try to properly cleanup the temporary profile:

  1. Stop the application pools
  2. Stop the IIS Admin Service
  3. Using right-click properties on computer, choose advanced tab and then pick User Profiles. There you can properly delete them.