In our system, the university libraries filled 90% of our textbook needs. Some books were highly sought after, especially physics and calculus, which were common for all STEM majors.
In those cases, we would run to the library first thing to get the books. If you missed out, someone would give you the PDF.
Professors would email the reading list before the first class with their recommendations, and even tell the students which libraries had each book. Other professors would have their notes and handbooks available on the website, and have some of the copy shops sell them for the cost of printing.