![在 ubuntu 中从 mariadbserver 安装 mariadb 时出现“找不到 curses 错误”](https://linux22.com/image/1193820/%E5%9C%A8%20ubuntu%20%E4%B8%AD%E4%BB%8E%20mariadbserver%20%E5%AE%89%E8%A3%85%20mariadb%20%E6%97%B6%E5%87%BA%E7%8E%B0%E2%80%9C%E6%89%BE%E4%B8%8D%E5%88%B0%20curses%20%E9%94%99%E8%AF%AF%E2%80%9D.png)
我根据以下内容在我的 ubuntu 中安装 MariaDB自述文件。
我的 ubuntu 版本是 22.04,我正在使用 MariaDB 分支 11.0。我已按照启动步骤操作,并且运行正常。
sudo gedit /etc/apt/sources.list.d/mariadb.list
之后,我将内容放入此文件的内容中并运行以下命令,执行完全正常。
sudo apt-get install software-properties-common \
devscripts \
equivs \
curl \
git
sudo apt-get build-dep mariadb-server
之后我运行这些命令,并且运行良好。
sudo curl -o /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc
'https://mariadb.org/mariadb_release_signing_key.asc'
sudo apt-get update
接下来是构建部分
cd ~
git clone https://github.com/{your-username}/maria-server
mkdir ~/maria-server-build
mkdir ~/maria-server-data
cd ~/maria-server-build
此后,当我运行此命令时,它会给出错误。
cmake ~/maria-server/ -DCMAKE_BUILD_TYPE=Debug
错误如下:
-- Wsrep-lib version: 1.0.0
CMake Error at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindCurses.cmake:268 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/readline.cmake:55 (FIND_PACKAGE)
cmake/readline.cmake:185 (FIND_CURSES)
CMakeLists.txt:389 (MYSQL_CHECK_READLINE)
我不明白是否有任何包裹丢失或出现其他问题。
更新: 我现在已经通过此命令安装了一些缺失的包。
sudo apt install libncurses-dev
但现在我遇到了一些不同的错误。
CMake Error at /usr/share/cmake-
3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find GnuTLS (missing: GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
(Required is at least version "3.3.24")
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindGnuTLS.cmake:68
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
libmariadb/CMakeLists.txt:336 (FIND_PACKAGE)
答案1
当我使用此命令时,错误发生了改变。
sudo apt install libncurses-dev
当我更改此命令时出现的错误如下:
CMake Error at /usr/share/cmake-
3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find GnuTLS (missing: GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
(Required is at least version "3.3.24")
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594
(_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22/Modules/FindGnuTLS.cmake:68
(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
libmariadb/CMakeLists.txt:336 (FIND_PACKAGE)
因此,当我使用此命令时,此错误已解决
sudo apt-get install gnutls-dev
之后,我收到与 bison 相关的错误。因此,我最后安装了 bison,错误已解决。
sudo apt-get install flex bison
解决该错误后,我使用此命令成功构建了 MariaDB。
cmake ~/maria-server/ -DCMAKE_BUILD_TYPE=Debug