fixing compat issues

threading changed in 4.0, supporting the new config syntax
update apt on repo setup
tempate fixes :D