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
yum install package_name
You will need root privileges to install the packages.
For installing GCC compiler type
yum install gcc
For installing GNU C++ compiler type
yum install gcc-c++
I tried to follow above commands for installing package but got following error.
Loaded plugins: fastestmirror 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
resolv.conf file. Type
and add following lines before other nameserver entries.
nameserver 220.127.116.11 nameserver 18.104.22.168
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 proxy server - proxy server:port number proxy=http://mycache.mydomain.com:3128 # The account details for yum connections proxy_username=yum-user proxy_password=qwerty
After completing this, I was able to install the packages using
yum. I will discuss more explorations in next article.