A caretaker government must exist when Parliament is dissolved to advise the Yang di-Pertuan Agong and to function as the government, said attorney-general Abdul Gani Patail.