Building from source on Debian12

Hi Guys,
I had succesfully installed the GVM on Debian 11, I updated the machine to Deb 12 yesterday and I wanted make update (at least to gvm-lib due to postgresql)

I followed the Documentation Building 22.4 from Source - Greenbone Community Documentation where is Debian stable (bookworm) under supported programs. The issue is probably the virtual environment in python3.11. I followed the guidlines:

mkdir -p $BUILD_DIR/gvm-libs && cd $BUILD_DIR/gvm-libs

cmake $SOURCE_DIR/gvm-libs-$GVM_LIBS_VERSION \
  -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
  -DCMAKE_BUILD_TYPE=Release \
  -DSYSCONFDIR=/etc \
  -DLOCALSTATEDIR=/var

make -j$(nproc)

And I got this error:

Traceback (most recent call last):
  File "/usr/local/bin/cmake", line 5, in <module>
    from cmake import cmake
ModuleNotFoundError: No module named 'cmake'
make: *** No targets specified and no makefile found.  Stop.

I tried install it over pip:

pip3 install cmake 
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.
    
    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.
    
    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

cmake is installed on the system:

apt search cmake|grep installed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

cmake/stable,now 3.25.1-1 amd64 [installed]
cmake-data/stable,now 3.25.1-1 all [installed,automatic]

Is there anyone else who had succes on Debian 12?

Best Regards

Hi,

in some kind you messed up your system installation. cmake is not a Python application. Therefore you can’t install it with pip. It seems to me you installed some Python script called cmake manually at /usr/local/bin/cmake. Your cmake binary application should be found at /us/bin/cmake. I really have no clue what you did, but first of all I would try to get rid of /usr/local/bin/cmake. If that still doesn’t work, it’s maybe better to start with a fresh system.

2 Likes

Hi bricks,
thanks for help. the cmake was some weird executable. Removing and reinstaling cmake fixed this issue

2 Likes

Coming in a bit late…but for others looking too…

Here’s a script I completed last week that will build the whole system on Debian 12,( plus also adds an Nginx SSL front end. There’s a docker build script there too that does the same thing only with the community containers. Just copy and paste the link to run the install menu

GVM Source Build script on github