How to name files in /etc/apt/sources.list.d/ to be ignored without warnings?

926

Solution 1

cat >> /etc/apt/apt.conf.d/98ignore_extensions << \EOF
# Follow the pattern to add more extensions to ignore.
Dir::Ignore-Files-Silently:: "\.gz$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";
Dir::Ignore-Files-Silently:: "\.list_$";
EOF

Solution 2

I just move the files to ../sources.list.disabled/.

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

According to the documentation

TLDR
Files need to have the following

extension:
- .list
- .sources

filename:
- contain letters (a-z and A-Z)
- digits (0-9)
- underscore (_)
- hyphen (-)
- period (.)

SOURCES.LIST.D
The /etc/apt/sources.list.d directory provides a way to add sources.list entries in separate files. Two different file formats are allowed as described in the next two sections. Filenames need to have either the extension .list or .sources depending on the contained format. The filenames may only contain letters (a-z and A-Z), digits (0-9), underscore (_), hyphen (-) and period (.) characters. Otherwise APT will print a notice that it has ignored a file, unless that file matches a pattern in the Dir::Ignore-Files-Silently configuration list - in which case it will be silently ignored.

Share:
926

Related videos on Youtube

Revassin
Author by

Revassin

Updated on September 17, 2022

Comments

  • Revassin
    Revassin over 1 year

    I am in a pinch. I need to update (PUT) a row with an associative array column in Parse.com . but I cannot figure out how to do this and I couldn't find anything in the documentation at parse.com . I am programming in PHP and I created my own cURL wrapper (In other words i need someone to tell me how the URL needs to look like).

  • Vi.
    Vi. over 13 years
    But mv tor.list{_,} looks nicer than mv ../source.list{.disabled,}/tor.list
  • nixda
    nixda over 11 years
    Hello and welcome to superuser. Although this will answer the question, would you mind to explain it a little bit more?
  • Revassin
    Revassin about 10 years
    Sorry I forgot to mention I meant a associative array with a key-value pair. I updated my question.
  • Fosco
    Fosco about 10 years
    associative arrays are encoded as objects in json, so, {'score':{'level1':10,'level2':5}}
  • Revassin
    Revassin about 10 years
    Hey Fosco, I appreciate your help but still have a question. It seems my previous information inside the array gets removed. The array looks like this "campaign":{{"dateAdded":"2014-04-30","id":"TQxDUMWYKI"},{"d‌​ateAdded":"2014-04-3‌​0","id":"KFxDUMWYKI"‌​}} . I only want to update the date in my first sub-array. Do I have to GET the entire array first in order to update the whole array without losing my previous information.
  • Fosco
    Fosco almost 10 years
    Yes, you'll have to get the whole object value and update it. Array column types (non-associative) can use the add/remove/addUnique methods to update without replacing the whole column data.