We consider a real function which depends on the distances between a variable point and the points of a finite subset A of a linear normed space X. We show that X is an inner product space if this function attains its local minimum on a barycenter of points of A with well-chosen weights. Our result generalizes classical results about characterization of inner product spaces and answers a question of R. Durier, which was posed in his article [J. Math. Anal. Appl. 207 (1997) 220–239].