YUM not working in my centos server

Hi Friends,

I am unable to update using yum command in CentOS 64 bit server please help me.

[root@testserver ~]# yum update
Loaded plugins: fastestmirror, security
Determining fastest mirrors
epel/metalink                                                                                                                                    |  11 kB     00:00
 * epel: fedora-epel.mirror.lstn.net
http://dl.atrpms.net/el6-x86_64/atrpms/stable/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
base                                                                                                                                             | 3.7 kB     00:00
centosplus                                                                                                                                       | 3.4 kB     00:00
epel                                                                                                                                             | 4.3 kB     00:00
epel/primary_db                                                                                                                                  | 3.6 MB     00:00
Error: xz compression not available
[root@testserver ~]#

Thanks
Kiran.

It’s due to not having proper DNS nameservers set in your /etc/resolv. conf file. First set following default DNS entries in this file and try to run yum command again, it will work for sure…

# vi /etc/resolv.conf 

Add these entries:

nameserver 8.8.8.8
nameserver 8.8.4.4

Hi Ravi thanks for the reply No its not working I have done something in /etc/yum.repos.d/ and unable to revert it please help

Below are the content in /etc/yum.repos.d/epel.repo

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
 #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

Which Linux distribution you are using? and under /etc/yum.repos.d/ directory how many repository list is there? can you paste the output of that directory here?

Below are the list of directories under /etc/yum.repos.d

atrpms-bleeding.repo  
atrpms.repo  
atrpms-testing.repo  
CentOS-Base.repo  
CentOS-Debuginfo.repo  
CentOS-Media.repo  
CentOS-Vault.repo  
epel.repo

Try to remove or move these following repositories to somewhere as backup and try again

atrpms-bleeding.repo
atrpms.repo
atrpms-testing.repo

Getting below message

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile

I see you’ve xz compression issue also, it’s due to wrong xz version installed, to fix such error, try these commands.

# yum remove epel-release
# yum install pyliblzma

Ravi this is production server so no issues to use rite because when I use yum update or install I am not able to do so. does this requires any precautions ?? please confirm

No need of any precautions, just try to run suggested commands to fix xz issue…

Below is the message i got

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
No package pyliblzma available.
Error: Nothing to do

No problems, have you tried yum update? or it still throwing same error?

Yes I am able to yum update now without any errors

Thanks alot Ravi you have saved me, this portal really helping me a lot please keep helping admins we are ever greatful to you.

Thanks
Kiran.

Then I think problem is resolved now, is there any thing I can do?

yes my issue resolved nothing else as of now thank you very much.

Download and install xz package
xz is a general-purpose data compression tool with command line syntax similar to
gzip(1) and bzip2(1). The native file format is the .xz format