Advance Auto Parts has agreed to sell its Worldpac subsidiary to Carlyle Group for $1.5 billion in cash.