Failed to synchronize cache for repo ‘updates’

Hi Readers!

Hope you are doing good.

Today we will be discussing one problem related to linux, which is very basic but  if you are new to linux then it’s good to know it.

Problem statement:

If we try to update the package or want to add any repo and if following error message can be seen:

Failed to synchronize cache for repo ‘updates’

Solution:

First try the stuff with -verbose option so that you could see the detailed logs.

Sometimes the repo  you are trying to work are deals with ipv4 only and if you have enabled ipv6 in your system then it wont work for you.

First check whether you have enabled ipv6 or not.

Command to check –

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

if it shows ‘0’ then you have enabled it or by default its enabled.

Now you need to make it disable explicitly then you need to make changes using either numcli command or adding following lines in /etc/sysctl.conf:

 

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

Now check the output of

cat /proc/sys/net/ipv6/conf/all/disable_ipv6

It should be 1. Hence we came to conclusion than ipv6 is disabled now.

Now check again the stuff which you want to do with repo. You may should not see the error if its related to ipv6.