A lot of people are advocating a gun based approach, either, on the one hand, more gun control, or, on the other hand, arming more people to defend themselves.
Here's an article about an actual school shooter
If you read this, you will note that this guy's stated motivation was to be famous. This supports my view that it is sensationalized press coverage that is encouraging copycats. If the press were required to limit reporting of these incidents to simple facts: location, number killed and injured, whether the suspect is at large, in custody, or dead, whether the incident is ongoing, and streets or areas closed -- no photos, no interviews -- then the incidents would stop.
Terror thrives on press attention. Without that attention, terrorism fades into the background noise. Numbers killed in these incidents are dwarfed by other possibly preventable incidents like: opioid overdoses, auto accidents; more common one-on-one shootings (including suicides), and medical mistakes.
45, in one of his many fake news claims, insisted that terrorist acts were under-reported, when in fact quite the opposite is true. They're over-reported -- made into high drama content to attract advertisers.
Thinking that we're somehow going to find all the whacko teen boys and prevent them from getting guns seems unrealistic to me. What seems realistic is to stop filling their media screens with the temptation to get famous by doing a public shooting.