Error: N: Ignoring file 'h' in directory '/etc/apt/sources.list.d/' as it has no filename extension

Hi Ubuntu community, I am new user to Ubuntu and fully switched from windows to Ubuntu it seems to me Great.
I need help i am getting warning or error as mention in heading can anyone guide me why it comes and how to resolve it?

by the way i am using Ubuntu 20.04.3 LTS

Thanks for the help
Regards Hassan

Welcome to Ubuntu MATE community!

Ubuntu MATE is Ubuntu flavor, based on Debian. Debian systems use special .list-files in /etc/apt folder to declare lists of software sources. The main file is placed at /etc/apt/sources.list. Auxiliary or user-created files maybe placed in the folder named /etc/apt/sources.list.d/ .

In your case you have a file named h which lacks .list extension. So you should first check that its contents are valid by

cat /etc/apt/sources.list.d/h

By valid I mean resulting line like deb http://mirror-name.com/software/ubuntu ubuntu-version main or something similar.

And then:

  • if file is valid - rename it by

     sudo mv /etc/apt/sources.list.d/h /etc/apt/sources.list.d/h.list
    
  • if file is invalid - remove it by

     sudo rm /etc/apt/sources.list.d/h
    

and then run sudo apt-get update to update software sources for APT.


References: Ubuntu Manpage: sources.list - List of configured APT data sources

1 Like

Thanks Norbert_X Problems is solved.

1 Like