无root权限主机的使用

概览:

在无(root)及sudo权限云主机配置编程环境

说明:由于没有root权限,所以全部安装及配置仅限当前个人用户目录

安装java环境

在主机上建立目录

1
2
3
4
5
6
cd ~ #进入你的家目录
mkdir ~/local_user_root
cd local_user_root/
mkdir local_misc #上传应用压缩包的目录。相当于备份
mkdir local_app_dir #真是安装的位置
mkdir local_usr #模拟根目录下的usr目录

目录结构

1
2
$ ls ~/local_user_root/
local_misc local_app_dir local_usr

下载JAVA SDK

如果无法直接下载上传到主机上
先下载到本地,在上传至远程主机

1
time scp  @hostip:~/local_user_root/local_misc>

解压java tar包

1
tar -zxvf  -C ~/local_user_root/local_app_dir #like xxx.tar.gz

添加到用户环境变量
编辑~/.bashrc文件

1
2
3
4
5
6
7
#JAVA
export JAVA_HOME=/home//local_user_root/local_app_dir/jdk-11.0.1
export JAVA_INCLUDE=${JAVA_HOME}/include
export CLASSPATH=.:${JAVA_HOME}/lib

#total add path
export PATH=${JAVA_HOME}/bin:$PATH

使配置生效,运行命令
source .bashrc

安装miniconda-python3

下载Miniconda3

1
axel https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh

安装Miniconda3-latest-Linux-x86_64.sh

1
sh Miniconda3-latest-Linux-x86_64.sh

更新Miniconda源(Anaconda& Miniconda通用)

1
2
3
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes

安装tmux

安装libeventncurses

1
2
3
cd ~/local_user_root/local_misc
axel https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
axel ftp://ftp.invisible-island.net/ncurses/ncurses.tar.gz

解压并编译安装libevent

1
2
3
4
5
6
7
tar -zxvf libevent-2.1.8-stable.tar.gz -C ../local_app_dir/
cd ../local_app_dir/libevent-2.1.8-stable

sh autogen.sh
./configure
make
make install DESTDIR=~/local_user_root/local_usr

解压并编译安装ncurses

1
2
3
4
5
tar -zxvf ncurses.tar.gz -C ../local_app_dir/
cd ../local_app_dir/ncurses-6.1/
./configure
make
make install DESTDIR=~/local_user_root/local_usr

调整环境变量
编辑~/.bashrc文件

1
2
3
4
5
6
#local lib dir
export LOCAL_USR_HOME=/home//local_user_root/local_usr

export C_INCLUDE_PATH=/usr/local/include:${LOCAL_USR_HOME}/usr/local/include:${LOCAL_USR_HOME}/usr/include
export LD_LIBRARY_PATH=/usr/local/lib:/usr/lin64:${LOCAL_USR_HOME}/usr/local/lib:${LOCAL_USR_HOME}/usr/lib
export LIBRARY_PATH=/usr/local/lib:/usr/lin64:${LOCAL_USR_HOME}/usr/local/lib:${LOCAL_USR_HOME}/usr/lib

使配置生效,运行命令
source .bashrc

编译安装tmux

1
2
3
4
5
6
7
cd ~/local_user_root/local_app_dir
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure
make
make install DESTDIR=~/local_user_root/local_usr

编辑~/.bashrc文件

1
2
#total add path
export PATH=${JAVA_HOME}/bin:${LOCAL_USR_HOME}/usr/local/bin:$PATH

使配置生效,运行命令
source .bashrc
然后测试运行tmux

------ 文章已经结束,谢谢你的阅读 ------
------ article has ended,thank you for reading ------
Thanks support Me

---------------- The End ----------------