<分区>
这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。
关闭 7 年前。
<分区>
这个问题似乎不是关于 a specific programming problem, a software algorithm, or software tools primarily used by programmers 的.如果您认为这个问题是关于 another Stack Exchange site 的主题,您可以发表评论以说明问题可能在哪里得到解答。
关闭 7 年前。
我需要你的帮助。
$ vagrant init ubuntu/trusty64
$ vagrant up
一切都很好。但是我不能“
$ sudo apt-get update
我总是得到
W: Failed to fetch
Could not resolve archive.ubuntu.com
发生了什么事?我的互联网连接工作正常,还是 Ubuntu 服务器有问题?
最佳答案
听起来您的基础盒子没有正确设置 DNS。尝试将 openDNS 添加到您的/etc/resolv.conf。
将以下内容添加到您的 vagrantfile(在配置部分)应该可以解决问题
Vagrant.configure("2") do |config|
...
config.vm.provision :shell, inline: "sudo echo nameserver 208.67.222.222 > /etc/resolv.conf"
...
end
添加后,只需运行“vagrant reload --provision”,然后 ssh 进入并重试
关于Ubuntu 14.01.1 LTS(apt-get 更新不工作),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26648386/
相关文章:
vagrant - Puppet - 如何仅在需要安装或更新软件包时运行 'apt-get update'
python - 如何在 virtualenv python 2.7 中安装 Django
ubuntu - 如何更改 xen 服务器 ubuntu 虚拟机上的 redmine 附件目录
Vagrant 与适用于 Windows 虚拟机的 Ansible
java - 如何远程调试java应用程序并将端口转发到虚拟机?
ruby - 从 Chef Cookbook 将 SASS 作为守护进程启动
testing - Vagrant:如何配置 vagrant 以使用不同的 Vagrantfile
php - 如何在 Google App Engine 中包含 PHP 的 MSSQL 驱动程序