Can't ping google, install package and clone source code from github

Posted February 23, 2021 783 views
Arch LinuxLinux CommandsGitHub Actions

When I pinged google, I saw: “unknown host”
When I clone the source, I saw: “can’t access to github”
When I install package, I saw: “Fail to fetch …”

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
4 answers

Hello, @nguyencules

What happens when you execute ifconfig -a can you see the eth0 interface listed? If this one is not present then we will need to sort this out.

I know that sometimes some packages can be uninstalled somehow on reboot and there are cases where cloud-init is one of them. You can check if the package is present and currently installed on your droplet as well.

A similar issue was reported here as well:

You can check the answer posted from lukasea17033bb7e7ecf80fc21 and see the suggested steps if needed.

  1. Create the /etc/udev/rules.d/70-persistent-net.rules file
  2. Reboot tje server
  3. Set the network interface using the information from the /etc/netplan/50-cloud-init.yaml file
  4. Set the routing
  5. Configure the DNS resolver conf file (you can skip this if your resolv conf is still present, I know you’ve mentioned that you’ve already copied this from a working droplet)
  6. You can run apt update and apt upgrade
  7. Install cloud-init if it’s missing

Also, have you tried to power off the droplet and then start it again instead of just rebooting it? You can perform this action from the control panel.

Let me know how it goes.


Hi @nguyencules,

It seems like your Network service is not running properly. Are you by any chance accessing your DigitalOcean droplet using the Web Console?

Additionally, once you are inside the droplet, can you try and execute the following command

service network restart

What does it say? When it restarts, try to ping google again and see what happens.


  • I can’t restart the network, can’t install yum, or do anything like trigger network because I saw: “network.service not found”.
    When I checked with the command line: systemctl is-active network, I saw: inactive.

    • Hi,

      It looks like you use RedHat8-derivative OS. If so, there is NetworkManager as default service for network management. Check its status:

      sudo systemctl status NetworkManager

      Try to restart it:

      sudo systemctl restart NetworkManager

      If NetworkManager is not installed or permanently disabled, try to find out what way the network is managed in your OS. Try following command:

      sudo journalctl | grep -i network

      Look for some clue in its result.

      It would be far more easier to troubleshoot the problem, if you provided us with more details on the system/software environment, and described the situation around the problem, I mean, how it arose, how you found out about it, what you have already done to fix it, etc.

Hi @nguyencules,

I’ll urge you to check @alexdo’ s answer. See if following his suggestions helps you with your network issue.

Please give it a try and let us know how did it go.


Hello, @nguyencules

I’m glad that you’ve sorted this!