Centos

在 CentOS 7 上安裝 iMod

  • March 26, 2022

我正在嘗試創建一個 shell 腳本來為我安裝一系列東西。其中之一就是 iMod。我找到了 iMod 的自安裝 shell 腳本,並在我的 bash 控制台上執行了以下命令:

export IMOD_VERSION=4.11.12
export CUDA_VERSION=10.1
wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_${IMOD_VERSION}_RHEL7-64_CUDA${CUDA_VERSION}.sh
sudo sh imod_${IMOD_VERSION}_RHEL7-64_CUDA${CUDA_VERSION}.sh

筆記

重新啟動設備並斷開連接並重新連接後問題仍然存在(通過 SSH,啟動新終端)

安裝輸出

$ export IMOD_VERSION=4.11.12
$ export CUDA_VERSION=10.1
$ wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_${IMOD_VERSION}_RHEL7-64_CUDA${CUDA_VERSION}.sh
--2022-02-02 03:16:12--  https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_4.11.12_RHEL7-64_CUDA10.1.sh
Resolving bio3d.colorado.edu (bio3d.colorado.edu)... 128.138.72.88
Connecting to bio3d.colorado.edu (bio3d.colorado.edu)|128.138.72.88|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 205325213 (196M) [application/x-sh]
Saving to: ‘imod_4.11.12_RHEL7-64_CUDA10.1.sh.1’

100%[===================================================================================================================>] 205,325,213 5.60MB/s   in 38s

2022-02-02 03:16:51 (5.21 MB/s) - ‘imod_4.11.12_RHEL7-64_CUDA10.1.sh.1’ saved [205325213/205325213]

$ sudo sh imod_4.11.12_RHEL7-64_CUDA10.1.sh

This script will install IMOD in /usr/local and rename
any previous version, or remove another copy of this version.

It will copy IMOD-linux.csh and IMOD-linux.sh to /etc/profile.d

You can add the option -h to see a full list of options

Enter Y if you want to proceed: y
Extracting imod_4.11.12_RHEL7-64_CUDA10.1.tar.gz ...
Extracting installIMOD
Checking system and package types
Saving the Plugins directory in the existing installation
Removing link to previous version but leaving previous version
Removing an existing copy of the same version...
Unpacking IMOD in /usr/local ...
Linking imod_4.11.12 to IMOD
Restoring the Plugins directory
Copying startup scripts to /etc/profile.d: IMOD-linux.csh IMOD-linux.sh

SELinux is enabled - Trying to change security context of libraries.

The installation of IMOD 4.11.12 is complete.
You may need to start a new terminal window for changes to take effect

If there are version-specific IMOD startup commands in individual user
startup files (.cshrc, .bashrc, .bash_profile) they should be changed
or removed.

Cleaning up imod_4.11.12_RHEL7-64_CUDA10.1.tar.gz, installIMOD, and IMODtempDir

我有時間嘗試重現您的問題。

庫存 CentOS 7.9 最小。

然後:

export IMOD_VERSION=4.11.12
export CUDA_VERSION=10.1
wget https://bio3d.colorado.edu/imod/AMD64-RHEL5/imod_${IMOD_VERSION}_RHEL7-64_CUDA${CUDA_VERSION}.sh
sudo sh imod_${IMOD_VERSION}_RHEL7-64_CUDA${CUDA_VERSION}.sh

輸出:

This script will install IMOD in /usr/local and rename
any previous version, or remove another copy of this version.

It will copy IMOD-linux.csh and IMOD-linux.sh to /etc/profile.d

You can add the option -h to see a full list of options

Enter Y if you want to proceed: Y
Extracting imod_4.11.12_RHEL7-64_CUDA10.1.tar.gz ...
Extracting installIMOD
Checking system and package types
Unpacking IMOD in /usr/local ...
Linking imod_4.11.12 to IMOD
Copying startup scripts to /etc/profile.d: IMOD-linux.csh IMOD-linux.sh

SELinux is enabled - Trying to change security context of libraries.

The installation of IMOD 4.11.12 is complete.
You may need to start a new terminal window for changes to take effect

If there are version-specific IMOD startup commands in individual user
startup files (.cshrc, .bashrc, .bash_profile) they should be changed
or removed.

Cleaning up imod_4.11.12_RHEL7-64_CUDA10.1.tar.gz, installIMOD, and IMODtempDir

安裝腳本似乎安裝了以下軟體/usr/local/IMOD

[test@centos7test ~]$ ll /usr/local/
total 0
<...>
lrwxrwxrwx.  1 root root  12 Feb  3 10:31 IMOD -> imod_4.11.12
drwxr-xr-x. 13 1095  111 286 Nov 19 12:32 imod_4.11.12
<...>

現在,註銷並登錄到您的 shell 非常重要,因為它需要獲取以下安裝在的程式碼/etc/profile.d/IMOD-linux.sh

<...>
export IMOD_DIR=${IMOD_DIR:=/usr/local/IMOD}

# Put the IMOD programs on the path
#
if ! echo ${PATH} | grep -q "$IMOD_DIR/bin" ; then
   export PATH=$IMOD_DIR/bin:$PATH
fi
<...>

這反映在您目前的$PATH環境變數中:

[test@centos7test ~]# echo $PATH
/usr/local/IMOD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

我現在成功地找到並執行了imodimodhelp二進製文件:

[test@centos7test local]# whereis imod imodhelp
imod: /usr/local/imod_4.11.12/bin/imod
imodhelp: /usr/local/imod_4.11.12/bin/imodhelp

如果由於某種原因您的機器沒有拾取文件,/etc/profile.d/IMOD-linux.sh您可以像這樣強制執行它:

[test@centos7test ~]# source /etc/profile.d/IMOD-linux.sh

引用自:https://unix.stackexchange.com/questions/688930