You will need a vcds or obd11pro , mabey carista to code in battery
But if you will replace like for like ( voltage amps ) you dont need to code anything
You wont be able to operate any aftermarket units as audi a6 c6 sound system is basted on MOST ( fiberoptics ) . Have you got red display or colour above the vents ?
I presume you can start the car ?
When you press the brake pedal there should be a sound of the lach disengaging that blocks the gear leaver. It might be that what is broken
Ebay would be your best call to keep checking.
Also when the fault comes back get the car to audi for vcds scan and find out what exactly the fault code is