Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


CentOS 6 Server Problem. Help Please
New on LowEndTalk? Please Register and read our Community Rules.

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

mahbubmahbub Member

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

«1

Comments

  • I would not recommend CentOS to start learning Linux.

    Debian or Ubuntu are much easier and more 'friendly'.

  • edited August 2013

    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.

  • @William said:
    I would not recommend CentOS to start learning Linux.

    Debian or Ubuntu are much easier and more 'friendly'.

    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.

  • netomxnetomx Moderator, Veteran

    @mahbub try "su root" and then install sudo and whatever you need

  • @WebSearchingPro said:
    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.

    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.

  • @netomx said:
    mahbub try "su root" and then install sudo and whatever you need

    I just tried. But it still says that permission denied. :(

  • DroidzoneDroidzone Member
    edited August 2013

    @mahbub said:
    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

    @mahbub said:
    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.

    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

    :(

  • DroidzoneDroidzone Member
    edited August 2013

    As ShardHost said, check if you have external connectivity. Ping google.com

    But after entering '/etc/resolv.conf' it says that: "-bash : /etc/resolv.conf : permission denied"

    Why are you trying to run a text file?

    To confirm my root privilege I entered command 'su -' but it don't want the password. Simply nothing happen after the command.

    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

  • @mahbub said:
    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

  • @nagug said:
    is network configured for virtualbox guests. What do you get for 'ifconfig'?

    I am using 'host only adapter'.

    When I put 'ifconfig' I get like this pic: http://oi43.tinypic.com/28rlkxt.jpg

  • @ErawanArifNugroho said:
    In Virtualbox, have you tried another network method? Like NAT/Bridge?

    I just use 'host only adapter'

  • @ShardHost said:
    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

    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.

  • @mahbub said:
    When I put 'ifconfig' I get like this pic: http://oi43.tinypic.com/28rlkxt.jpg

    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'

  • @mahbub said:
    I just use 'host only adapter'

    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.

  • @mahbub said:
    I just use 'host only adapter'

    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:

    1. apt vs. yum as the package manager

    2. Different locations for configuration files. /etc/apache2 vs. /etc/httpd for instance

    Learn the above two and everything else is just minor stuff.

  • AbdussamadAbdussamad Member
    edited August 2013

    @isy44h112 said:
    where are you from? indonesia?

    I am guessing somewhere in south asia like Bangladesh.

  • @Abdussamad said:
    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.

  • @isy44h112 said:
    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.

    Really? :O

  • @isy44h112 said:
    I guess he's from indonesia because tyey are CentOS fan.

    That's a rather broad deduction, considering that almost anyone who uses cpanel starts off with CentOS.

    Thanked by 1ErawanArifNugroho
  • BrianHarrisonBrianHarrison Member, Patron Provider
    edited August 2013

    @William said:
    I would not recommend CentOS to start learning Linux.

    Debian or Ubuntu are much easier and more 'friendly'.

    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.

Sign In or Register to comment.