2

I'm reading a book on Linux, which somewhat poorly explains what Linux does when you install packages with yum.

When you run yum install packagehere, the first thing that linux does is to check /etc/yum.conf file to see where the sotfware repository is located. I have no /etc/yum.conf on my freshly installed system.

Since I have no /etc/yum.conf, then the first thing must be checking /etc/yum.repos.d folder. In it I have fedora.repo, fedora-cisco-openh264.repo, fedora-updates.repo, fedora-updates-testing-repo.

Each of this files has a line(s) starting with #baseurl.

Lets say I run yum install httpd How do I know (actually how does Linux know) which baseurl contains the package httpd? Does it scan through all of them?

2

All package managers do it in their own way, but all share a mostly general concept of software repositories.

Generally a package manager finds the base url, downloads an index of packages and their versions sometimes with other information (like file lists, checksums, relative path, etc), looks up the package in the index, and then downloads the package by constructing the proper URL from the baseurl and imformation it finds in the index.

1

You can try the verbose mode, the last mentioned baseurl or *.repo file mentioned in the console output is the one chosen. Normally if the repository contains the said program in the XML metadata, then it "found" the program from your install command.

You can check out the following response to see how yum works internally: https://www.redhat.com/archives/rhl-list/2008-January/msg02246.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.