Today I tried CentOS for first time. As a newbie I struggled with it for quite some time. This struggle left me with some of the learning. I thought of sharing that learning here with all.
Installing package on CentOS:
You can install any package from repositories by typing
You will need root privileges to install the packages.
For installing GCC compiler type
For installing GNU C++ compiler type
I tried to follow above commands for installing package but got following error.
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
By searching over Google, I came to know that this is something to do with nameservers. To configure your name servers you can edit
and add following lines before other nameserver entries.
This will set the nameservers to Google nameservers, which might help in resolving the issue.
yum with a Proxy Server
But, it too didn’t resolve the issue for me. After some time, I realized that I was using a proxy server to connect to internet. So I need to make
yum get trough the proxy server. To do so you need to make entries for proxy server in your
/etc/yum.conf file. Enter following lines:
# The account details for yum connections
After completing this, I was able to install the packages using
yum. I will discuss more explorations in next article.