安装虚拟机
Deploying a Red Hat Enterprise Linux 7 (RHEL7) on VirtualBox
使用VMware推荐的经典简易安装方式,为RHEL7.2预留了8G硬盘和2G memory
在虚拟机中新建一个目标环境用来测试迁移,目标环境是 RHEL7.4,为了增加难度在模拟迁移中,在虚拟机新建 RHEL7.2,过程中遇到报错:
无法打开配置文件“D:\VMware\RHEL7.2\Red Hat Enterprise Linux 7.2.vmx”: 拒绝访问。
再次使用管理员权限打开VMware成功解决。
文件传输
虚拟机安装完成后第一件事就是将win10中的文件放入虚拟机中,尝试了共享文件但失败了,改用Xshell连接虚拟机,使用FTP传输文件。
RHEL中 ipconfig查看虚拟机ip,输入账户密码后成功登录,进行文件传输。

安装anaconda
- $ bash ....sh
- Bash is a Unix shell and command language which can run Shell Script files.
- The installer prompts “Do you wish the installer to initialize Anaconda3 by running conda init?” We recommend “yes”. Installing on Linux
cd ~
source .bashrc
~
The ~ (tilde) is a quick way of specifying your home directory. A home directory is the directory or folder commonly given to a user on a network or Unix or Linux variant operating system. With the home directory the user can store all their personal information, files, login scripts, and user information. With a Linux web server, the home directory is also where you'd find the public_html directory containing all files used for a website.
.bashrc
Ever Wonder Why it's Called .bashrc?
In our various wanderings around the Linux file system, we have encountered files with names that end with the mysterious suffix "rc" like .bashrc, .vimrc, etc. Heck, many distributions have a bunch of directories in /etc named rc. Why is that? It's a holdover from ancient Unix. Its original meaning was "run commands," but it later became "run-control." A run-control file is generally some kind of script or configuration file that prepares an environment for a program to use. In the case of .bashrc for example, it's a script that prepares a user's bash shell environment.
如果你运行一个基于 Unix 或者类 Unix 的操作系统,bash 很有可能是作为默认终端被安装的。虽然存在很多不同的 shell,bash 却是最常见或许也是最主流的。如果你不明白那意味着什么,bash 是一个能解释你输入进终端程序的东西,并且基于你的输入来运行命令。它在一定程度上支持使用脚本来定制功能,这时候就要用到 .bashrc 了。
为了加载你的配置,bash 在每次启动时都会加载 .bashrc 文件的内容。每个用户的 home 目录都有这个 shell 脚本。它用来存储并加载你的终端配置和环境变量。
突发!磁盘满了
查看磁盘空间
df
扩张磁盘空间
并不知道root用户的密码
Reset the root user password on rhel7 xcentos7 x
改了个寂寞,并没有成功改变root密码,到目前为止操作变得复杂起来,还是重新装一个虚拟机吧。
Moving Anaconda Enverironment
打包环境
$ pip install conda-pack
# Pack environment my_env into out_name.tar.gz
$ conda pack -n my_env -o out_name.tar.gz
ps. 打包的时候一定要指定输出文件类型为.tar.gz
安装环境
# Unpack environment into directory `my_env`
$ mkdir -p my_env
$ tar -xzf my_env.tar.gz -C my_env
# Use Python without activating or fixing the prefixes. Most Python
# libraries will work fine, but things that require prefix cleanups
# will fail.
$ ./my_env/bin/python
# Activate the environment. This adds `my_env/bin` to your path
$ source my_env/bin/activate
# Run Python from in the environment
(my_env) $ python
# Cleanup prefixes from in the active environment.
# Note that this command can also be run without activating the environment
# as long as some version of Python is already installed on the machine.
(my_env) $ conda-unpack
添加激活环境快捷键
通过vim ~/.bash_profile,向里面添加alias activeEnv='source /home/my_env/bin/activate',source ~/.bash_profile之后可以直接在命令行输入activeEnv激活相应环境
conda创建新环境

本文详细介绍了如何在无网络环境下,通过VMware部署RHEL虚拟机,并使用Xshell通过FTP传输文件。接着讲解了Anaconda在Linux上的安装,特别是~符号和.bashrc文件的作用。在磁盘空间不足的情况下,尝试扩展磁盘未果,选择重新安装虚拟机。最后,阐述了如何打包和迁移Anaconda环境,以及添加激活环境的快捷方式。
1362





