Had to do it a few times. Had to run 4 miles with a 45 pound rucksack a few times too. The easiest way to train up for a 10k is to interval train. Run 1 mile. Stop and breathe for about 2-3 minutes. Run another mile. Stop and breathe for about 2-3 minutes.
If you do that for every mile, and decrease 15-30 seconds off of the interval rest time, you'll work up to 10k within a few months in no problem.