With plastic there is trash to deal with, but glass is heavier thus will take more energy to deal with logistically. Recycling is not energy free either, and there is plenty of loss to deal with there. Plastic is very cheap to manufacture partly because its manufacture is so easy.
And right now it seems like energy consumption is a far larger worry than trash at the ecological level.
If you have local production and re-use of glass it can be more energy efficient to use the more heavy glass. The further the transport, the worse it becomes.
But there is a second factor to it, besides energy use: microplastics are a problem and most plastics can only be used for "energetic usage" - being burned in a power plant, which causes probelmatic gases needing filtering and then disposal of those filters ... re-use of broken glass is elementary in glass production and even if not recycled less of a problem for the environment.
My family has been using the same set of glasses for canning for decades.
When we were using glass jars for everything, it's not like glass jars were not actively being produced. I don't think these are unanswerable questions but i highly doubt it's as simple as "replace plastic with glass". Aluminum may be a better solution, one that doesn't use up a lot of sand, for example.
Well, I lived in a socialist country; as a consequence, DIY was the default for obtaining stuff. So quite average I guess.
I am old enough to remember when there was practically no plastic in food packaging. Twinkies and its ilk were more or less the exception (and fine examples they were of that exception!).
No doubt many remember glass ketchup bottles, glass mustard jars, glass peanut butter jars, glass mayonnaise jars... I swore to continue to buy only glass condiment jars but they no longer exist. I think the exception now is jams and jellies still come in glass jars. Honey too if you look for it.
Cereal? No plastic bag liner, it was wax paper or that weird paper foil stuff that Super Sugar Crisp came in.
I'd love to go back to glass, wax paper, but there just isn't any options any longer.