github主页: https://github.com/axel-download-accelerator/axel
mkdir -p ~/tools
cd ~/tools
wget https://github.com/axel-download-accelerator/axel/releases/download/v2.17.11/axel-2.17.11.tar.gz
tar zxvf axel-2.17.11.tar.gz 
cd axel-2.17.11/先建一个(加-p选项,如果之前已存在也不影响)
mkdir -p ~/.local默认的前缀路径/usr/local,可执行文件会被装到/usr/local/bin下
冰墩墩只在自己主目录有权限,所以只能在自己家作威作福,那就改一下前缀路径。
./configure --prefix=~/.local麻烦事总是那么多,比如它报了个找不到openssl的错:
checking for openssl... no
configure: error: Package requirements (openssl) were not met:
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables SSL_CFLAGS
and SSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.其实启用root用包管理器安装一下openssl(apt install libssl-dev openssl)就好了,但如果root根本就懒得理你呢?
话接上一集,conda是已经装过openssl的(conda list看看)。
但是我还是不知道应该怎么写o(╥﹏╥)o
屏幕提示运行pkg-config,但是系统也没有哇(root只要apt install pkg-config就行)
我们普通用户是得学会用conda自力更生了。
conda搜一下再装一下:
conda search pkg-config 
conda install pkg-config然后找一下openssl的c编译器flag应该怎么写,在configure的时候加上就好了
pkg-config --cflags openssl得到
-I/home/bingdwendwen/miniconda3/includeFLAGS的写法
Some influential environment variables:
  PKG_CONFIG  path to pkg-config utility
  PKG_CONFIG_PATH
              directories to add to pkg-config's search path
  PKG_CONFIG_LIBDIR
              path overriding pkg-config's built-in search path
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  SSL_CFLAGS  C compiler flags for SSL, overriding pkg-config
  SSL_LIBS    linker flags for SSL, overriding pkg-config
  CPP         C preprocessor现在我知道怎么configure了
./configure --prefix=$HOME/.local CFLAGS='-I/home/bingdwendwen/miniconda3/include'make
make install还差一点点,系统还没收到通知!
通过PATH变量给Linux系统发一下通知,让它下次知道也去这个目录下找找可执行程序
(可以先通过echo $PATH确认一下有没有已经加上了。其实在我的系统里,在~/.profile里已经有了,所以下面这一步export不需要执行的。当然执行了也不会出错,无非也就是PATH里有重复而已。)
export PATH=$HOME/.local/bin:$PATH其实,这样在终端直接export,只会在当前窗口生效。 写到配置文件里去吧,例如~/.bashrc。$前的斜杠是转义字符,这是追加到~/.bashrc里。可以用tail看看是不是在最后一行?
(当然啦,在我的系统里,这个路径已经在~/.profile里定义过了,没必要再重复定义。你们的系统应该跟我一样的,那其实也没必要做这一步的。)
echo "export PATH=\$HOME/.local/bin:\$PATH" >> ~/.bashrc 
tail ~/.bashrc 

只要把可执行程序(可以是你自己写的具有x权限的任何程序)放到PATH变量里的任意一个目录下(或者就自己把这个目录加到PATH里去),就可以直接运行啦。
echo -e "echo \"\`whoami\` says: 我会4A!我超可爱的,不接受反驳!\"\ndate" > hello
chmod +x hello
./hello
mv hello ~/.local/bin/
hello增加点难度,我再来写一个新的hello,然后把当前工作目录加到PATH的最前面,看看系统会运行哪一个。
echo -e "echo \"\`whoami\` says: 我来给大家介绍一下我的好朋友,它的名字叫雪容融\"\ndate +\"%F %T\"" > hello
chmod +x hello
export PATH=.:$PATH
hello你们看出来了吗?