I've installed CentOs 7 on my server and realized for some unknown reasons (at least by me), default yum repositories doesn't not work.
for example I tried yum install vim
but got
Loaded plugins: fastestmirror
One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: addons/7
I searched through the net to realize what's the problem and couldn't find anything. So I decided I should add the default repositories which should've been added by default myself.
But I couldn't find out how.
So is there a way to do that and make yum work?
The link which I've downloaded CentOs 7:
http://mirror.teklinks.com/centos/7.3.1611/isos/x86_64/CentOS-7-x86_64-Everything-1611.iso
EDIT 2
By cleaning all repositories and adding new ones from here considering my CentOS version the error is gone:
# yum clean all
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
# rpm -Uvh http://dl.atrpms.net/all/atrpms-repo-7-7.el7.x86_64.rpm
# rpm -Uvh http://repo.webtatic.com/yum/el7/webtatic-release.rpm
But now by running yum install vim
I get:
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: ftp.riken.jp
* remi-safe: rpms.remirepo.net
* webtatic: uk.repo.webtatic.com
No package vim available.
Error: Nothing to do
rpm -Uvh http://mirror.rackspace.com/CentOS/7/os/x86_64/Packages/centos-release-7-3.1611.el7.centos.x86_64.rpm