OK, apt remove codeblocks leaves libcodeblocks behind. I needed to apt remove libcodeblocks.
Next issue. When I run codeblocks I get
codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory
libcodeblocks.so exists in /usr/local/lib
Oddly if I install to a non-standard prefix e.g /home/myhome/whatever and run it from there, it finds libcodeblocks from /home/myhome/whatever/lib/ and runs correctly.