I have a couple things to add. Firstly, if you're getting rid of your CDs and can't get any money out of them, do the planet a favor and send them to a media recycle location. For example, you could send them to
http://www.cdrecyclingcenter.org/. They ask for a donation to help keep them afloat, and I feel the small donation is worth it to keep these things out of landfills.
Also, while it is
technically illegal to rip your music and resell the discs, I highly doubt you will be caught. But you are still breaking the law.
All that being said, I do own some CDs. The ones I have, however, I use and they are very specific albums from very specific artists. For example, I am a huge Zao fan and own all their work (with one exception) on CD/cassette/vinyl.
When it comes to music, unless I am a giant fan of the artist, I'm not going to buy their music at all, much less on physical discs and whatnot. I will use a plethora of alternatives including library CDs, Hoopla Digital (library streaming service), free Pandora, YouTube, BandCamp and the radio.