E: Syntax error /etc/apt/apt.conf.d/01autoremove:4: Extra junk after value
-
Looks like there is some garbage in /etc/apt/apt.conf.d/01autoremove. Please provide the file contents. – framp Sep 24 '18 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 '18 at 20:24
-
can i change the content of the file? – Hamza.Engineer Sep 24 '18 at 20:26
-
Yes, just copy the file from a clean system. – framp Sep 24 '18 at 20:29
-
@Hamza.Engineer please edit the question and do not put the requested information in the comments. Thanks! – Ghanima♦ Sep 25 '18 at 20:29
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.