sudo yum install pygpgme yum-utils<\/pre>\nThe built-in preinstalled repositories on CentOS unfortunately do not contain the latest version of ClickHouse – this is why we’ll be installing a repository that has the latest version for CentOS. Before installing this repository, we will first need to add some repository details which will secure and validate our ClickHouse packages.<\/p>\n
For this tutorial, we’ll be using ‘vi’ as our text editor of choice. You are free to use your preferred text editor if you like. We will now create the repository file by using the following command:<\/p>\n
sudo vi \/etc\/yum.repos.d\/altinity_clickhouse.repo<\/pre>\nNext, we will add the following content to the file:<\/p>\n
[altinity_clickhouse]\r\nname=altinity_clickhouse\r\nbaseurl=https:\/\/packagecloud.io\/altinity\/clickhouse\/el\/7\/$basearch\r\nrepo_gpgcheck=1\r\ngpgcheck=0\r\nenabled=1\r\ngpgkey=https:\/\/packagecloud.io\/altinity\/clickhouse\/gpgkey\r\nsslverify=1\r\nsslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt\r\nmetadata_expire=300\r\n\r\n[altinity_clickhouse-source]\r\nname=altinity_clickhouse-source\r\nbaseurl=https:\/\/packagecloud.io\/altinity\/clickhouse\/el\/7\/SRPMS\r\nrepo_gpgcheck=1\r\ngpgcheck=0\r\nenabled=1\r\ngpgkey=https:\/\/packagecloud.io\/altinity\/clickhouse\/gpgkey\r\nsslverify=1\r\nsslcacert=\/etc\/pki\/tls\/certs\/ca-bundle.crt\r\nmetadata_expire=300<\/pre>\nWhen you are finished with adding the text, save and close the file.<\/p>\n
Once you have added the repositories, you’ll need to enable them by executing the following command:<\/p>\n
sudo yum -q makecache -y --disablerepo='*' --enablerepo='altinity_clickhouse'<\/pre>\nYou should see an output similar to the following:<\/p>\n
Importing GPG key 0x0C7EG6F3:\r\nUserid : \"https:\/\/packagecloud.io\/altinity\/clickhouse\u00a0 <support@packagecloud.io>\"\r\nFingerprint: 6102 38a9 7c50 3h82 28bf 3f16 wg56 5vf3 0f6g 8df2\r\nFrom : https:\/\/packagecloud.io\/altinity\/clickhouse\/gpgkey<\/pre>\nAfter successfully configuring the repository, we will be able to install the packages with the following command:<\/p>\n
sudo yum install -y clickhouse-server clickhouse-client<\/pre>\nThe ClickHouse server and client have been installed successfully.<\/p>\n