Fixing segmentation fault in libapt-pkg

I received the message “Segmentation fault” while running an apt-get install. My syslog contained the following lines:

Aug 11 11:34:19 srv kernel: [65729.407484] check-new-relea[12700]: segfault at 7f2dfd94746c ip 00007f2dfc0becd8 sp 00007fffd0671d20 error 4 in libapt-pkg.so.4.12.0[7f2dfc069000+11c000]
Aug 11 11:35:52 srv kernel: [65822.603384] apt-get[12820]: segfault at 7f7d256e346c ip 00007f7d24252cd8 sp 00007fffdbb89140 error 4 in libapt-pkg.so.4.12.0[7f7d241fd000+11c000]

I fixed it with

dpkg-reconfigure libapt-pkg4.12