6
N: Ignoring file 'cloudera.list_' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'opera.list_' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
...
N: Ignoring file 'tor.list_' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

How to properly "comment out" files there?

5 Answers 5

5
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
1
  • Hello and welcome to superuser. Although this will answer the question, would you mind to explain it a little bit more?
    – nixda
    Jan 14, 2013 at 18:38
4

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

1
  • But mv tor.list{_,} looks nicer than mv ../source.list{.disabled,}/tor.list
    – Vi.
    Jan 19, 2011 at 16:14
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)

1

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.

0

Similar to larsks answer: I use the same kind of directory hierarchy as Apache (/etc/apache2) or Fontconfig (/etc/fonts).

The idea is to have two directories:

  • something.avail for all your files.
  • something.d that contains symlinks to the files you actually use.

Code speaks better than words, so here it comes.

cd /etc/apt
mv sources.list.d sources.list.avail
mkdir sources.list.d
cd sources.list.d
# Now you can symlink the files you want to use
ln -s ../sources.list.avail/liquorix.list
ln -s ../sources.list.avail/goodvibes.list
...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .