You may have a few reasons for removing and replacing the oil pan on an Audi A4. Maybe you'd like to replace a leaky oil pan gasket or maybe you need to replace the oil pan because it became damaged. Removing the oil pan on an A4 is not extremely difficult, though it does require that the engine be jacked up away from the subframe and the subframe dropped away from the motor. If this seems daunting, you may be better off having a professional do this job.
Raise the front of the Audi with the floor jack and place it securely on jack stands. You can remove the wheels as well if you would like some extra room.
Remove the oil pan drain plug and drain the oil into a suitable container. Remove all of the 10mm bolts on the perimeter of the oil pan that hold it on. Once the bolts are removed, the pan will come down and rest on the subframe.
Remove the 13mm bolts that hold the front engine mount in place. Remove the engine mount and set it aside, noting the orientation of the spacers and washers.
Remove the two 17mm nuts on the bottom of the side engine mounts. Jack up the engine about 4 inches by placing the jack under the small ear at the front of the engine block. Place a piece of wood between the engine and the jack. Very carefully jack the engine up a few inches, keeping an eye on the coolant hoses to avoid pulling on them.
Remove the two 17mm bolts that hold the subframe to the chassis. The subframe should come down about 4 inches. The oil pan can now be removed from the engine. Be extremely careful at this point since nothing but the jack is holding the motor in place and preventing it from falling from the car.
Apply a small layer of gasket sealant to the new oil pan. Place the new gasket in place. Apply a layer of sealant to the bottom of the engine block.
Install the oil pan onto the engine and tighten all of the bolts that hold it on. Reattach the subframe with the two 17mm bolts. You may need to use a second floor jack to lift the subframe up to the attachment points.
Lower the jack that is holding the engine up until you can realign the side engine mounts of the motor with the subframe. Install the bolts that fasten the motor mounts in place. Reinstall the front motor mount with the two bolts. Lower the Audi from the jack stands. Fill the motor with oil, start the motor and check for oil leaks.