OpenCloudOS Server 8 配环境


因为OpenCloudOS的yum源的问题,所以最好先安装这个包

yum install epel-release -y

然后安装一个htopscreen

yum clean all
yum update
yum install htop
yum install screen

安装Node.js

yum install nodejs

安装python3.11

./configure --enable-optimizations --with-lto --enable-bolt
make
make install

配置pip镜像源

pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple

配置npm镜像源

npm install -g nrm

nrm换源

[root@VM-16-16-opencloudos ~]# nrm ls

  npm ---------- https://registry.npmjs.org/
  yarn --------- https://registry.yarnpkg.com/
  tencent ------ https://mirrors.cloud.tencent.com/npm/
  cnpm --------- https://r.cnpmjs.org/
  taobao ------- https://registry.npmmirror.com/
  npmMirror ---- https://skimdb.npmjs.com/registry/

[root@VM-16-16-opencloudos ~]# nrm use tencent

   Registry has been set to: https://mirrors.cloud.tencent.com/npm/

安装python时遇到常见问题的解决方案

  Some possibly relevant errors from pip install:
      error: subprocess-exited-with-error
-     ModuleNotFoundError: No module named '_ctypes'
      error: metadata-generation-failed
 
  Error installing poetry.

需要安装一个库

yum install libffi-devel -y

重新安装,在make一步出现了这样的报错

The necessary bits to build these optional modules were not found:
_bz2                  _dbm                  _gdbm
_hashlib              _lzma                 _ssl
_tkinter              _uuid                 nis
readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


The following modules found by detect_modules() in setup.py have not
been built, they are *disabled* by configure:
_sqlite3


Could not build the ssl module!
Python requires a OpenSSL 1.1.1 or newer

参考网上的文章,要安装这些依赖

yum groupinstall "Development Tools"
yum install zlib-devel bzip2-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libpcap-devel xz-devel uuid-devel
yum install sqlite*
yum install -y zlib openssl-devel sqlite-devel bzip2-devel libffi libffi-devel gcc gcc-c++

~/swapfiles下创建3GB的swap

dd if=/dev/zero of=./swap-1024x3000000 bs=1024 count=3000000
chmod -R 0600 ./swap-1024x3000000
mkswap ./swap-1024x3000000
swapon ./swap-1024x3000000
echo "/root/swapfiles/swap-1024x3000000 swap swap defaults 0 0" >> /etc/fstab

配置JupyterLab密码

jupyter server --generate-config
jupyter server password

安装gh

yum install yum-utils
yum-config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
yum install gh