Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the function of /etc/apt/sources.list.d?

Tags:

debian

apt

I added LLVM Debian/Ubuntu nightly packages in the /etc/apt/sources.list.d directory as llvm.list. Then I ran apt-get update, but got the following error

GPG Error: The LLVM Compiler Infrastructure Project llvm-toolchain-trusty InRelease: no public key,can not qulify the signature: NO_PUBKEY 15CF4D18AF4F7421

I thought if I added the source as a file in the directory, it will be seen as a package source. What else do I need to do?

like image 867
ggaaooppeenngg Avatar asked Sep 24 '14 15:09

ggaaooppeenngg


People also ask

What is ETC APT sources list used for?

Upfront, the /etc/apt/source. list is a configuration file for Linux's Advance Packaging Tool, that holds URLs and other information for remote repositories from where software packages and applications are installed.

What does Sources List D do?

list. d directory provides a way to add sources. list entries in separate files. The format is the same as for the regular sources.

Where is etc apt sources?

The main Apt sources configuration file is at /etc/apt/sources. list. You can edit this files (as root) using your favorite text editor.

What is sources list Linux?

The sources. list file is a key factor in adding or upgrading applications to your Ubuntu installation. This is also used by your system for system updates. The file is basically the roadmap for your system to know where it may download programs for installation or upgrade.


1 Answers

The function of the /etc/apt/sources.list.d directory is as follows:

Using the directory you can easily add new repositories without the need to edit the central /etc/apt/sources.list file. I.e. you can just put a file with a unique name and the same format as /etc/apt/sources.list into this folder and it is used by apt.

In order to remove this source again you can just remove that specific file without the need for handling side effects, parsing or mangling with /etc/apt/sources.list. It's mainly for scripts or other packages to put their repositories there automatically - if you manually add repositories you could add them to /etc/apt/sources.list manually.

This answers your question, however, it won't solve your problem. APT is complaining about a missing GPG key which you have to manually import before you can use your newly added repository (GPG verifies all data cryptographically and needs the public keys of the owners for this).

This can be done calling sudo apt-key add public-key-file or wget -qO - http://example.com/archive.key | sudo apt-key add - where http://example.com/archive.keyis the URL for the public key (which you should verify before using).

In case of llvm, you could issue wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add - (according to http://llvm.org/apt/)

See https://askubuntu.com/questions/291035/how-to-add-a-gpg-key-to-the-apt-sources-keyring

like image 71
MrTux Avatar answered Sep 20 '22 09:09

MrTux