I've read How to solve "Extra junk at end of file" when using apt? and though it's a similar problem, it apparently has a different cause since, looking at the contents of the file, unlike in the earlier Q&A it seems far from obvious that adding apostrophes could solve the issue.
An error occurred, please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong. The error message was: 'Unknown Error: '' (E: Syntax error /etc/apt/apt.conf.d/01autoremove-kernels:1: Extra junk at end of file)'. This usually means that your installed packages have unmet dependencies.
Contents of problematic
/etc/apt/apt.conf.d/01autoremove-kernels (please note, however, that
gedit complains about invalid characters):