If you're willing to keep the book in storage indefinitely and ship it anywhere in the world that improves your odds. If you just want the library to take your old books you might have worse luck.
My local library has a book sale every year. I don't give them trash like outdated software manuals but I take them some bags of books over the course of a year to at least offset any new books I bring in. I'm sure a lot of them end up getting pulped anyway but at least I've tried to give them new homes. No way I'm going to the trouble of trying to sell books (or anything else for a few dollars) at a sub-minimum wage value of my time.