All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
CentOS 6 Server Problem. Help Please
I am new in server management. I recently setup centos 6 in virtualbox. Then I am trying to install nginx. In time I see I haven't install 'sudo' . Then I am trying to install sudo but it seems to me that 'apt-get' isn't installed. After that I appears to me that wget isn't installed. It is a great pain.
So I am trying to install wget by 'yum -y install wget' and this time I see following error:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...x86_64&repo=os error was
14: PYCURL ERROR 6 - ""
Error: Cannot find a valid baseurl for repo: base
Huh! I trying to solve this problem by searching google. I find a solution which is:
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
rpm -Uvh ftp://rpmfind.net/linux/redhat/linux...9.1-17.src.rpm
But after entering '/etc/resolv.conf' it says that:
"-bash : /etc/resolv.conf : permission denied"
To confirm my root privilege I entered command 'su -' but it don't want the password. Simply nothing happen after the command.
I am trying to understand server management so please help me. I will be great full to you.
Thanks,
mahbub
Comments
I would not recommend CentOS to start learning Linux.
Debian or Ubuntu are much easier and more 'friendly'.
Have you tried 'su' without the hyphen. Do 'whoami' to make sure you are actually root.
Edit: Would have to partially agree with William, you seem to know about apt-get already so use whatever you have more experience in.
I have a server where I am using ubuntu and I have some idea about ubuntu server management.. But I have to learn centos for using cpanel/whm.
@mahbub try "su root" and then install sudo and whatever you need
Yes I have tried 'su' without hyphen. Using 'whoami' I just sure that I am root user.
I don't understand what you mean by partially agree.
I just tried. But it still says that permission denied.
If you are root, then why do you need sudo? Just type whatever command you want, without prefixing "sudo".
Centos does not use apt package manager. In many cases, you can substitute "apt-get", with "yum"
Like:
apt-get update => yum update
apt-get install curl => yum install curl
In that case, read up about rpm package management
Provide the output of
ping google.com
and
cat /etc/yum.repos.d/CentOS-Base.repo
@joelgm my problem still continues though I am using 'yum'
I just type 'yum update' but it says to me:
Could not retrieve mirrorlist http://mirrorlist.centos.org/?releas...x86_64&repo=os error was 14: PYCURL ERROR 6 - "" Error: Cannot find a valid baseurl for repo: base
As ShardHost said, check if you have external connectivity. Ping google.com
Why are you trying to run a text file?
That's exactly what is supposed to happen if you run su as root!
If everything is messed up, just reinstall your OS, and start over. Retry the tutorial commands without using sudo. Should work.
@ShardHost I just use 'ping google.com'
It reply that:
ping: unknown host google.com
Isnt this a VPS? Just reinstall it.
is network configured for virtualbox guests. What do you get for 'ifconfig'?
In Virtualbox, have you tried another network method? Like NAT/Bridge?
To simplify things, simply edit resolv.conf using a text editor.
vi /etc/resolv.conf
Press i
type in:
nameserver 8.8.8.8
nameserver 8.8.4.4
press ESC, then hold shift and press Z Z
Then try to ping google
I am using 'host only adapter'.
When I put 'ifconfig' I get like this pic: http://oi43.tinypic.com/28rlkxt.jpg
I just use 'host only adapter'
Bro I just do this. But when I give ping google.com it says:
ping: unknown host google.com
ifconfig does not show an Ethernet interface.
As i doubted. Network is not configured properly. Your linux, dont have internet connectivity. Try NAT or Bridge mode. then run ifconfig again. You should get some proper ip, not just 127.0.0.1. (you may need to restart once you change the network mode..not sure)
After that try 'yum update -y'
THERE'S YOUR PROBLEM! You need to use either the NAT or the Bridged option if you want to be able to connect to the Internet from your VM.
That's why you can't access the internet. Try to shutdown the virtualbox, change the vm network to NAT, and start it again. Set the IP to auto, reboot the vm, and try connect the internet
where are you from? indonesia?
Broadly speaking the difference between Debian/Ubuntu and CentOS can be summed up in two lines:
apt vs. yum as the package manager
Different locations for configuration files. /etc/apache2 vs. /etc/httpd for instance
Learn the above two and everything else is just minor stuff.
I am guessing somewhere in south asia like Bangladesh.
I guess he's from indonesia because tyey are CentOS fan. Nothing wrong with CentOS.
I still remember there is someone from indonesia wants to turn his laptop into a server and plans to establish hosting company in his room.
CentOS is fine. I used it for years.
Really? :O
That's a rather broad deduction, considering that almost anyone who uses cpanel starts off with CentOS.
If he wants to get into system administration in web hosting environments, then learning CentOS/RHEL is an excellent decision. CentOS is by far the most common OS choice among hosts of all kinds.