A commercial for an upcoming movie got me thinking about works in which the genres of science fiction and western are combined. I've done some preliminary searching online, and it appears that while there are numerous examples of comics and television shows and movies that combine elements of science fiction and westerns, there are relatively few books. The wikipedia page for Science fiction Western lists only three, the earliest being Stephen King's Dark Tower series (which I have not read).
I was surprised that the first listed novel dates back only to 1982. Are there any other, earlier novels that combine science fiction with the elements that most of us associate with westerns: dusty, frontier towns, saloons, gunslingers, etc?