...and I know you didn't ask for specific recommendations, but I'll give some anyway
Since you like Pratchett you might like Martha Wells' Murderbot series, starting with All Systems Red, and Sarah Rees Brennan's In Other Lands. Both are funny, but with a serious undertone, have some very sharp comments on our current society, and have protagonists that are fundamentally good people (if not comfortable to be around).
I've only read a few of Harry Harrison's Steel Rat book, and only liked one of them, but for stories about space opera style heroes you might like Lois McMaster Bujold's Vorkosigan series, starting with Shards of Honor (also published together with the next book in the series as Cordelia's Honor), and Ann Leckie's Ancillary Justice.
I don't know Rankin (have some vague recollection of trying one of his and bouncing off it).