How do remove "Ignoring file in directory /etc/apt/sources.list.d/ as it has an invalid filename extension?

To fix your first problem run this in a terminal:

sudo rm /etc/apt/sources.list.d/*.disable

(An older version of the package management tool left these files when you disabled the PPAs. Removing them is pretty safe)

Your second problem comes from and old Karmic repository. To find out which one run this in a terminal:

cd /etc/apt

grep -rw karmic *

Once you know which repository it comes from it would be easy to disable/remove it.


maybe you should try this command:

sudo sh -c "echo 'Dir::Ignore-Files-Silently:: \"(.save|.distupgrade)$\";' > /etc/apt/apt.conf.d/99ignoresave"

 


[kubuntu 18.04]

I could not work out why the suffixes .distUpgrade and .save were ignored when there did not appear to be anything that explicitly sets this.

Then I discovered apt-config dump | grep -i ignore has entries for these and others:

Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.ucf-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";

I just renamed my dodgy one to be of of those extensions. (I chose .orig)


I had a similar issue in Ubuntu MATE 15.04. After

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"

and

wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -

and

sudo apt-get update

I had this message:

N: Ignoring file 'pgdg.listwget' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

I solved this way:

sudo mv /etc/apt/sources.list.d/pgdg.listwget /etc/apt/sources.list.d/pgdg.list