We derive new upper bounds for the densities of measurable sets in ℝ_n_ which avoid a finite set of prescribed distances. The new bounds come from the solution of a linear programming problem. We apply this method to obtain new upper bounds for measurable sets which avoid the unit distance in dimensions 2; . . . ; 24. This gives new lower bounds for the measurable chromatic number in dimensions 3; . . . ; 24. We apply it to get a short proof of a variant of a recent result of Bukh which in turn generalizes theorems of Furstenberg, Katznelson, Weiss, Bourgain and Falconer about sets avoiding many distances.