0

E: Syntax error /etc/apt/apt.conf.d/01autoremove:4: Extra junk after value

5
  • Looks like there is some garbage in /etc/apt/apt.conf.d/01autoremove. Please provide the file contents.
    – framp
    Sep 24, 2018 at 20:07
  • I have ho clue how you manage to destroy the contents of this file. It should be a readable file: My starts with APT { NeverAutoRemove { "^firmware-linux.*"; "^linux-firmware$"; }; VersionedKernelPackages { # linux kernels
    – framp
    Sep 24, 2018 at 20:24
  • can i change the content of the file? Sep 24, 2018 at 20:26
  • Yes, just copy the file from a clean system.
    – framp
    Sep 24, 2018 at 20:29
  • @Hamza.Engineer please edit the question and do not put the requested information in the comments. Thanks!
    – Ghanima
    Sep 25, 2018 at 20:29

1 Answer 1

0

Like @framp said, just copy the file from a clean system.

Here's my /etc/apt/apt.conf.d/01autoremove, from an up-to-date raspbian stretch:

APT
{
  NeverAutoRemove
  {
    "^firmware-linux.*";
    "^linux-firmware$";
  };

  VersionedKernelPackages
  {
    # linux kernels
    "linux-image";
    "linux-headers";
    "linux-image-extra";
    "linux-signed-image";
    # kfreebsd kernels
    "kfreebsd-image";
    "kfreebsd-headers";
    # hurd kernels
    "gnumach-image";
    # (out-of-tree) modules
    ".*-modules";
    ".*-kernel";
    "linux-backports-modules-.*";
        # tools
        "linux-tools";
  };

  Never-MarkAuto-Sections
  {
    "metapackages";
    "contrib/metapackages";
    "non-free/metapackages";
    "restricted/metapackages";
    "universe/metapackages";
    "multiverse/metapackages";
  };

  Move-Autobit-Sections
  {
    "oldlibs";
    "contrib/oldlibs";
    "non-free/oldlibs";
    "restricted/oldlibs";
    "universe/oldlibs";
    "multiverse/oldlibs";
  };
};

If it happens again, you might need to re-burn raspbian onto your sd card. If it still happens again, it might mean your sd card is corrupt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.