Install dependencies including libxcb-composite0-dev
which is sometimes not mentioned.
$ sudo apt-get install cmake cmake-data libcairo2-dev libxcb1-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-randr0-dev libxcb-util0-dev libxcb-xkb-dev pkg-config python-xcbgen xcb-proto libxcb-xrm-dev i3-wm libasound2-dev libmpdclient-dev libiw-dev libcurl4-openssl-dev libpulse-dev libxcb-composite0-dev
Clone the official Polybar repository.
$ git clone https://github.com/jaagr/polybar.git
Start the installation script and accept the build options you would like to install.
$ cd ./polybar
$ ./build.sh
Then you should have a working installation if everything went well.
$ polybar --version
polybar 3.3.0-81-gf1061e1
Features: +alsa +curl +i3 +mpd +network(wireless-tools) +pulseaudio +xkeyboard