How do remove "Ignoring file in directory /etc/apt/sources.list.d/ as it has an invalid filename extension?
Solution 1
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.
Solution 2
maybe you should try this command:
sudo sh -c "echo 'Dir::Ignore-Files-Silently:: \"(.save|.distupgrade)$\";' > /etc/apt/apt.conf.d/99ignoresave"
Solution 3
[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
)
Solution 4
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
Related videos on Youtube
JackLametta
Updated on September 18, 2022Comments
-
JackLametta almost 2 years
I have a JSON which contains some filter criteria like
{ { field: 'estimatedTime', operator: '<=' value: '50' }, { field: 'message', operator: 'contains' value: 'meow' }, ... }
I correctly translate it in a query
{'$elemMatch': { 'estimatedTime': {'$lte': 50}, 'message': {'$regex': 'meow'}}}
I'm using elemMatch since the query needs to be run on a JSON with a nested array. Let's call that array field 'properties'. I launched the query on the MongoDB and it works fine.
Problem is when I use the query in Node.js
users_with_filters.forEach(function(value) { console.log(res.id); var criteria = {}; criteria['$elemMatch'] = JSON.parse(value.filter[0].filter).criteria; console.log(criteria); Topic.find({'_id': new ObjectId('599ea4b7b924bf16409c67cc'), 'properties': criteria}, function (err, person) { if (err) { console.log(err); //return res.send(err); } console.log("Topic: " + person) }); })
console.log("Topic: " + person) prints nothing at all.
While if I hardcode the query like:
Topic.find({'_id': new ObjectId('599ea4b7b924bf16409c67cc'), 'properties': {'$elemMatch': { 'estimatedTime': {'$lte': 50}, 'message': {'$regex': 'meow'}}}}, function (err, person) ...
console.log("Topic: " + person) prints what I am looking for.
What am I doing wrong? Thanks.
-
DrBeco almost 3 yearsJust rename
*disable
to*disabled
and it will be silent.
-
-
Avinash Raj about 10 yearsMoving .disable files to another location would be better than deleting.
-
unil over 8 yearsThis would only mask the issue, maybe suggest a way to remove the files?
-
Himanshu sharma almost 7 yearswhat you are getting when you print console.log(criteria); in my approach
-
Pedro Gimeno almost 5 yearsThe dots should probably be escaped.
-
northern-bradley over 4 yearswould this actually do anything as all the files that the op has listed are suffixed
.disabled
whereas the answer only has suffixes.save
and.distupgrade
-
SHW almost 4 yearsI have the exact same problem as Flair, namely N: Ignoring file 'nginx.list.save.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension. But when I enter the command sudo rm /etc/apt/sources.list.d/*.disable, I get the message: rm: cannot remove '/etc/apt/sources.list.d/*.disable': No such file or directory. Anything else I can try?
-
SHW almost 4 yearsFor all the newbies like me, I found the solution myself. Use command sudo rm /etc/apt/sources.list.d/nginx.list.save.1 to get the specific file removed.
-
DrBeco almost 3 yearsJust rename
*disable
to*disabled
and it will be silent, no need to delete anything.