The short answer to your question is The Kid from Texas starring Audie Murphy. It was a B-movie of the period (1950) about Billy the Kid. It was a remake of a 1939 film by the same name.
The plot involves Billy the Kid who stops the arrest of a rancher on behalf of the "bad guy," Major Harper. Because of this, the rancher gives Billy a job as a ranch hand. Harper's men attack the rancher and kill him one night after drinking too much. Billy responds to the death of the "father figure" by going on a killing rampage. Kain, who seemed to be a good guy at the beginning of the film, encourages him to kill off any rivals, but turns on Billy for political gain. Billy is forced to run to the hills, but is caught. He is sentenced to be hung for his crimes, but manages to escape. During this time, he learns about Kain's betrayal. He chooses to remain in the area to be near Kain's wife, Irene, whom he loves. He wants her to know the truth. Billy invades Kain's home and holds the house hostage. There, Irene learns the truth and leaves Kain but will have nothing to do with Billy. Sheriff Garrett sets fire to the house but Billy escapes. The story ends with Billy being shot by Pat Garrett while standing in front of the house where Irene is staying. The movie was not highly budgeted and was paired with other higher budget films in order to get into the theaters.
The Last Picture Show is a coming of age story about teenagers in a small town, finishing high school and moving on to their adult lives. During the 1950s, with the advent of television, the movie theaters became a haven for teenagers. Many of the films made during this period were specifically designed for teen audiences. At the end of the book, the movie theater closes. In many ways, this is symbolic of the end of Sonny and Duane's teenage years. The fact that McMurtry chose The Kid from Texas is selective rather than coincidental.
Billy the Kid's revelations about life in the movie parallel some of the instances that happen to Sonny and Duane. Most importantly, both in the movie and in the book Billy and Sonny are trapped. Billy refuses to leave because he cannot leave Irene; it ultimately kills him. Sonny, on the other hand, is tied to Thalia and cannot leave due to fear of the unknown and a reluctance to move on. He ends up going back to his old girlfriend. Both protagonists begin their stories as immature, naive but reckless boys; however, they both learn the hardships of betrayal and love. Neither one is able to mature enough to leave and build another life where they will fill the emptiness in them; they are both trapped.