2022-01-18 11:41:33 +00:00
|
|
|
LATEST_VERSION=$(curl -s https://packages.clickhouse.com/tgz/stable/ | \
|
2020-03-20 16:00:11 +00:00
|
|
|
grep -Eo '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | sort -V -r | head -n 1)
|
2022-01-18 11:41:33 +00:00
|
|
|
export LATEST_VERSION
|
2020-03-13 19:35:03 +00:00
|
|
|
|
2022-06-29 10:33:20 +00:00
|
|
|
case $(uname -m) in
|
|
|
|
x86_64) ARCH=amd64 ;;
|
|
|
|
aarch64) ARCH=arm64 ;;
|
|
|
|
*) echo "Unknown architecture $(uname -m)"; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
for PKG in clickhouse-common-static clickhouse-common-static-dbg clickhouse-server clickhouse-client
|
|
|
|
do
|
|
|
|
curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION-${ARCH}.tgz" \
|
|
|
|
|| curl -fO "https://packages.clickhouse.com/tgz/stable/$PKG-$LATEST_VERSION.tgz"
|
|
|
|
done
|
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
tar -xzvf "clickhouse-common-static-$LATEST_VERSION-${ARCH}.tgz" \
|
|
|
|
|| tar -xzvf "clickhouse-common-static-$LATEST_VERSION.tgz"
|
2022-01-18 11:41:33 +00:00
|
|
|
sudo "clickhouse-common-static-$LATEST_VERSION/install/doinst.sh"
|
2020-03-13 19:35:03 +00:00
|
|
|
|
2022-06-29 10:33:20 +00:00
|
|
|
tar -xzvf "clickhouse-common-static-dbg-$LATEST_VERSION-${ARCH}.tgz" \
|
|
|
|
|| tar -xzvf "clickhouse-common-static-dbg-$LATEST_VERSION.tgz"
|
2022-01-18 11:41:33 +00:00
|
|
|
sudo "clickhouse-common-static-dbg-$LATEST_VERSION/install/doinst.sh"
|
2020-03-13 19:35:03 +00:00
|
|
|
|
2022-06-29 10:33:20 +00:00
|
|
|
tar -xzvf "clickhouse-server-$LATEST_VERSION-${ARCH}.tgz" \
|
|
|
|
|| tar -xzvf "clickhouse-server-$LATEST_VERSION.tgz"
|
2022-01-18 11:41:33 +00:00
|
|
|
sudo "clickhouse-server-$LATEST_VERSION/install/doinst.sh"
|
2020-03-13 19:35:03 +00:00
|
|
|
sudo /etc/init.d/clickhouse-server start
|
|
|
|
|
2022-06-29 10:33:20 +00:00
|
|
|
tar -xzvf "clickhouse-client-$LATEST_VERSION-${ARCH}.tgz" \
|
|
|
|
|| tar -xzvf "clickhouse-client-$LATEST_VERSION.tgz"
|
2022-01-18 11:41:33 +00:00
|
|
|
sudo "clickhouse-client-$LATEST_VERSION/install/doinst.sh"
|