Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

After I installed Fedora 20 on my new computer, I could not use 'yum install' because I just got a long string of error messages.

I first posted this question on this site: "How can I get yum and the internet browser to work after fresh Fedora 20 installation" which gives the full details of the errors I got early on.

After nearly six weeks of frustration I finally found the answer in:

http://qandasys.info/fedora-19-unable-to-update-or-install-could-not-resolve-host/

Answer by Stramash November 4, 2013 at 2:24 pm

Resolved this by adding nameserver 8.8.8.8 above my router’s address in resolv.conf that was obtained by DHCP.

I had also asked, here: "I have to do this edit every time I log on, and I would like to make it permanent." and soon found an answer in:

https://lists.fedoraproject.org/pipermail/users/2011-August/403189.html

So I did this edit:

vi /etc/sysconfig/network-scripts/ifcfg-p20p1

changing the line: PEERDNS=yes to PEERDNS=no

Although this all works, I am not sure why. What I would, please, like is to read a detailed description of what yum does to locate an installation package, the files associated with this process, and how they can be modified or configured if necessary, for instance as a flow chart or list.

share|improve this question
2  
Which is the error you have? –  Braiam Mar 31 at 11:32
1  
Instead of adding the extra DNS directly in resolv.conf, add it in Network Manager, as Network Manager generates your resolv.conf. –  Leiaz Mar 31 at 11:55
    
yum uses http requests to download updates. This means that you need to have a valid DNS server, IP address, gateway, etc setup to download updates. Unrelated but this is virtually how all package managers work including apt and pacman –  josten Mar 31 at 12:14
    
Exactly what does resolve.conf look like before you do that? –  goldilocks Mar 31 at 13:07
1  
@goldilocks OP had already posted it here when trying to fix the problem with yum. –  Leiaz Mar 31 at 13:33

1 Answer 1

This is not a problem with yum it seems but DNS resolution instead.

It seems that the dns settings that you manually add to /etc/resolv.conf are overwritten everytime you boot your machine or renew network connection by network manager.

A good way to find out is to check the first lines of the resolv.conf file. If you see something like "this file was generated automatically.." then it is likely that you can't modify this file permanently.

If you are using DCHP to get IP settings, you should check your router settings and confirm that it provides a dns server ( it depends on router model, search on google) NOTE: if you can't control your dns settings in router. you can do semi-automatic configuration in network manager ( see Fedora's doc)

If you are using static IP, go to network manager settings to define one.

Here the Fedora's doc chapter

share|improve this answer
1  
+1 If your router does provide DNS, or has an external address that does (it should), it will tell the DHCP client that and the DHCP client will write that address into resolve.conf, I believe. Kind of strange this does not happen. –  goldilocks Mar 31 at 13:07
    
This can be controlled in dhclient.conf. See entry: request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, But I don't think Harry touched this? –  rMistero Mar 31 at 13:55
    
The suggestions, for which I am grateful, all need a deeper understanding of the system than I have, hence the final paragraph of my question. –  Harry Weston Mar 31 at 16:15
1  
network-manager takes precedence on network-scripts as far as I know. I would suggest that you revert any change you have made to the device network scripts and follow my advice. If you are unfamiliar with Linux, you should use network-manager (see link in answer) to configure your network settings. Again you are describing a DNS resolution issue, not a yum related problem. –  rMistero Mar 31 at 16:47
1  
@Harry, I don't assume that you know network-manager this is why I gave you the links to the doc on how to use it. If you are interested in understanding how network-manager works in the backend, you will find plenty of answers on the internet. –  rMistero Apr 1 at 18:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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