In addition to my local library, I also have access to a provincial-level library that offers complementary
online resources, including all of O'Reilly's collection (lots of technical
books).
Rarely do I need to stray from there. Anything that's not available online can generally be ordered through inter-library loans (very useful for small rural libraries!)
And don't forget that many libraries will buy books if you recommend them.