vagrant + centos + anaconda + git 迅速配置

添加box

添加box的命令如下:

vagrant box add base 远端的box地址或者本地的box文件名
vagrant box add 是添加box的命令

base是box的名称,可以是任意的字符串,base是默认名称,主要用来标识一下你添加的box,后面的命令都是基于这个标识来操作的。

例子:

vagrant box add base http://files.vagrantup.com/lucid64.box
vagrant box add base https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box
vagrant box add base CentOS-6.3-x86_64-minimal.box
vagrant box add "CentOS 6.3 x86_64 minimal" CentOS-6.3-x86_64-minimal.box

vagrant box add base lucid64.box
安装过程的信息:

Downloading or copying the box…
Extracting box…te: 47.5M/s, Estimated time remaining: –:–:–)
Successfully added box ‘base’ with provider ‘virtualbox’!
box中的镜像文件被放到了:/Users/astaxie/.vagrant.d/boxes/,如果在window系统中应该是放到了: C:\Users\当前用户名.vagrant.d\boxes\目录下。

通过vagrant box add这样的方式安装远程的box,可能很慢,所以建议大家先下载box到本地再执行这样的操作。

初始化
初始化的命令如下:

vagrant init

如果你添加的box名称不是base,那么需要在初始化的时候指定名称,例如

vagrant init "CentOS 6.3 x86_64 minimal"

初始化过程的信息:

A Vagrantfile has been placed in this directory.
You are now ready to vagrant up your first virtual environment!
Please read the comments in the Vagrantfile as well as documentation on vagrantup.com for more information on using Vagrant.
这样就会在当前目录生成一个 Vagrantfile的文件,里面有很多配置信息,后面我们会详细讲解每一项的含义,但是默认的配置就可以开箱即用。

启动虚拟机
启动虚拟机的命令如下:

vagrant up

使用locale命令设置语言环境

把默认的修改为英文:

vi  /etc/sysconfig/i18n
LANG="en_US.UTF-8"
source /etc/sysconfig/i18n

anaconda安装

For Python 2.7

wget https://repo.continuum.io/archive/Anaconda2-4.3.0-Linux-x86_64.sh

For Python 3.3

wget https://repo.continuum.io/archive/Anaconda3-4.3.0-Linux-x86_64.sh

For Python 2.7

bash Anaconda2-4.3.0-Linux-x86_64.sh

For Python 3.3

bash Anaconda3-4.3.0-Linux-x86_64.sh

安装的时候选择添加到环境变量时YES

source ~/.bashrc #conda环境马上生效

git安装

yum info git
yum install -y git

猜你喜欢

转载自blog.csdn.net/nockinonheavensdoor/article/details/80057750