Updating package index is very slow due to large 'Contents' entries

Probably, apt-file was installed at some point and its entry (or "trigger" if i can say) got set in /etc/apt/apt.conf.d/

  • You could keep apt-file and disable its config in apt, using this command:

      sudo sh /usr/share/doc/apt-file/examples/apt-file-2-update.sh --install
    

    or Manually by commenting the lines in /etc/apt/apt.conf.d/50apt-file.conf by prepending #.

    Then you can use apt update & apt-file update separately as needed (Separation of concerns).

  • Also you may tweak /etc/apt/apt-file.conf to set only needed indexes to be downloaded. Or Purge apt-file if not required any more.

Reference: man apt-file