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

160

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
Share:
160

Related videos on Youtube

JackLametta
Author by

JackLametta

Updated on September 18, 2022

Comments

  • JackLametta
    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
      DrBeco almost 3 years
      Just rename *disable to *disabled and it will be silent.
  • Avinash Raj
    Avinash Raj about 10 years
    Moving .disable files to another location would be better than deleting.
  • unil
    unil over 8 years
    This would only mask the issue, maybe suggest a way to remove the files?
  • Himanshu sharma
    Himanshu sharma almost 7 years
    what you are getting when you print console.log(criteria); in my approach
  • Pedro Gimeno
    Pedro Gimeno almost 5 years
    The dots should probably be escaped.
  • northern-bradley
    northern-bradley over 4 years
    would 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
    SHW almost 4 years
    I 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
    SHW almost 4 years
    For 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
    DrBeco almost 3 years
    Just rename *disable to *disabled and it will be silent, no need to delete anything.