The most common technique for this is stacking and using masks and layers. I've done this with panoramas in PTGui, using their masking feature to erase ghosts and clones, but I don't think there's any free way of automating this task, because you need to identify the people you want to erase, and you also need to shoot enough "clean plate" to cover all the areas with people. Depending on your shooting situation and how much people are moving, this could be impossible.
The only automatic way I know of doing this would require a current Photoshop license. But File → Scripts → Statistics, with the Stack Mode set to Median will basically do what you're talking about, so long as the people are all moving from image to image in the set. (See this phlearn.com Youtube video).
A simpler technique is to use a very long exposure with an ND filter. So long as most people are moving in your shot, they won't register on the image. Just beware of people who are standing still. I had a beach shot I took with a B+W 110 (10-stop ND filter). 40s exposure managed to erase the multitude of surfers on the waves, but not the one person standing by the dock who didn't move the whole time.