Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:ClickHouse ClickHouse Dpkg Rpm Install

From Leeroopedia


Knowledge Sources
Domains Packaging
Last Updated 2026-02-08 00:00 GMT

Overview

Concrete tool for validating ClickHouse packages through installation testing using the external system package managers dpkg (Debian/Ubuntu) and rpm (RHEL/CentOS/Fedora).

Description

Package validation is performed by installing the generated DEB or RPM packages on a target system (or container) and verifying that the installation completes successfully. This exercises the full package lifecycle: dependency checking, file extraction, permission setting, post-install script execution, and service enablement.

The ClickHouse package set has a strict installation order due to inter-package dependencies. The clickhouse-common-static package must be installed first because both clickhouse-server and clickhouse-client declare an exact-version dependency on it. Debug packages (clickhouse-common-static-dbg and clickhouse-keeper-dbg) have no inter-package dependencies and can be installed at any time.

The low-level tools (dpkg -i and rpm -i) do not resolve dependencies from repositories, so the installation order must be managed manually. Higher-level tools like apt install and dnf install can resolve local dependencies automatically when all packages are provided together.

Usage

Use these tools when validating ClickHouse packages in CI/CD pipelines, testing package builds locally, or deploying ClickHouse from locally-built packages rather than from a repository.

Code Reference

Source Location

  • Repository: N/A (external system tools)
  • Relevant ClickHouse files:
    • packages/clickhouse-common-static.yaml -- Base package definition
    • packages/clickhouse-server.yaml -- Server package definition
    • packages/clickhouse-client.yaml -- Client package definition
    • packages/clickhouse-common-static-dbg.yaml -- Debug symbols package
    • packages/clickhouse-keeper-dbg.yaml -- Keeper debug symbols package
    • packages/clickhouse-server.postinstall -- Server post-install script

Signature

DEB Installation (Debian/Ubuntu)

# Low-level installation (manual dependency ordering):
dpkg -i clickhouse-common-static_${VERSION}_${ARCH}.deb
dpkg -i clickhouse-server_${VERSION}_${ARCH}.deb
dpkg -i clickhouse-client_${VERSION}_${ARCH}.deb

# Optional debug packages:
dpkg -i clickhouse-common-static-dbg_${VERSION}_${ARCH}.deb
dpkg -i clickhouse-keeper-dbg_${VERSION}_${ARCH}.deb

RPM Installation (RHEL/CentOS/Fedora)

# Low-level installation (manual dependency ordering):
rpm -i clickhouse-common-static-${VERSION}.${ARCH}.rpm
rpm -i clickhouse-server-${VERSION}.${ARCH}.rpm
rpm -i clickhouse-client-${VERSION}.${ARCH}.rpm

# Optional debug packages:
rpm -i clickhouse-common-static-dbg-${VERSION}.${ARCH}.rpm
rpm -i clickhouse-keeper-dbg-${VERSION}.${ARCH}.rpm

High-Level Installation with Dependency Resolution

# DEB with automatic dependency resolution:
apt install ./clickhouse-common-static_*.deb \
            ./clickhouse-server_*.deb \
            ./clickhouse-client_*.deb

# RPM with automatic dependency resolution:
dnf install ./clickhouse-common-static-*.rpm \
            ./clickhouse-server-*.rpm \
            ./clickhouse-client-*.rpm

I/O Contract

Inputs

Name Type Required Description
clickhouse-common-static_${VERSION}_${ARCH}.deb Debian package Yes (for DEB) Base package containing the main clickhouse binary
clickhouse-server_${VERSION}_${ARCH}.deb Debian package Yes (for server) Server package with configuration, services, and post-install script
clickhouse-client_${VERSION}_${ARCH}.deb Debian package Yes (for client) Client tools package with symlinks and client configuration
clickhouse-common-static-dbg_${VERSION}_${ARCH}.deb Debian package No Optional debug symbols for the main binary
clickhouse-keeper-dbg_${VERSION}_${ARCH}.deb Debian package No Optional debug symbols for the Keeper binary
Equivalent .rpm files RPM packages Yes (for RPM) Same contents in RPM format for Red Hat-based systems

Outputs

Name Type Description
/usr/bin/clickhouse Installed binary Main ClickHouse binary (from clickhouse-common-static)
/usr/bin/clickhouse-server Installed symlink/binary Server entry point (from clickhouse-server)
/usr/bin/clickhouse-client Installed symlink Client tool symlink (from clickhouse-client)
/etc/clickhouse-server/config.xml Configuration file Server configuration (from clickhouse-server)
/etc/clickhouse-server/users.xml Configuration file User access configuration (from clickhouse-server)
/lib/systemd/system/clickhouse-server.service systemd unit Server service definition (from clickhouse-server)
clickhouse user and group System account Created by post-install script with no login shell
/var/lib/clickhouse Data directory Created by post-install with ownership clickhouse:clickhouse and mode 0700
/var/log/clickhouse-server Log directory Created by post-install with ownership clickhouse:clickhouse and mode 0770

Installation Order

The following diagram shows the required installation order:

clickhouse-common-static          (MUST be installed first)
    |
    +-- clickhouse-server         (depends on common-static at exact version)
    |
    +-- clickhouse-client         (depends on common-static at exact version)

clickhouse-common-static-dbg      (independent, install any time)
clickhouse-keeper-dbg             (independent, install any time)

Validation Checks

After installation, the following checks verify a successful install:

Structural Checks

# Verify the binary is installed and executable:
test -x /usr/bin/clickhouse

# Verify symlinks resolve correctly:
readlink -f /usr/bin/clickhouse-client
readlink -f /usr/bin/clickhouse-local

# Verify configuration files are in place:
test -f /etc/clickhouse-server/config.xml
test -f /etc/clickhouse-server/users.xml
test -f /etc/clickhouse-client/config.xml

# Verify systemd unit is installed:
test -f /lib/systemd/system/clickhouse-server.service

Functional Checks

# Verify binary executes and reports version:
clickhouse --version

# Verify client tool dispatch works:
clickhouse-client --version
clickhouse-local --version

# Verify the clickhouse user was created:
id clickhouse

# Verify data directories exist with correct ownership:
stat -c '%U:%G %a' /var/lib/clickhouse
# Expected: clickhouse:clickhouse 700

# Verify the server service is enabled:
systemctl is-enabled clickhouse-server

DEB-Specific Checks

# List installed files for a package:
dpkg -L clickhouse-common-static

# Verify package status:
dpkg -s clickhouse-server

# Check for broken dependencies:
apt-get check

RPM-Specific Checks

# List installed files for a package:
rpm -ql clickhouse-common-static

# Verify package integrity:
rpm -V clickhouse-server

# Check for unresolved dependencies:
rpm -q --requires clickhouse-server

Usage Examples

Full DEB installation in a Docker container

# Start a clean Debian container:
docker run -it --rm debian:bookworm bash

# Copy packages into the container (from host):
# docker cp clickhouse-*.deb container_id:/tmp/

# Install in order:
dpkg -i /tmp/clickhouse-common-static_24.3.1.1_amd64.deb
dpkg -i /tmp/clickhouse-server_24.3.1.1_amd64.deb
dpkg -i /tmp/clickhouse-client_24.3.1.1_amd64.deb

# Verify:
clickhouse --version
clickhouse-client --version
id clickhouse

Full RPM installation in a Docker container

# Start a clean RHEL-based container:
docker run -it --rm almalinux:9 bash

# Install in order:
rpm -i /tmp/clickhouse-common-static-24.3.1.1.x86_64.rpm
rpm -i /tmp/clickhouse-server-24.3.1.1.x86_64.rpm
rpm -i /tmp/clickhouse-client-24.3.1.1.x86_64.rpm

# Verify:
clickhouse --version
clickhouse-client --version
id clickhouse

Related Pages

Implements Principle

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment