🇬🇧 🇫🇷 🇪🇸

Installation methods

With Python

You can easily install TBlock on any machine with Python installed on it, by running:

# pip install tblock

Since it isn't always recommended to run pip as root, you may want to install it in a virtual environment.

On Ubuntu

You can easily install TBlock on any Ubuntu-based Linux distribution, by running:

$ sudo add-apt-repository ppa:twann4/tblock
$ sudo apt-get update
$ sudo apt-get install tblock

On Fedora

You can easily install TBlock on any Fedora-based Linux distribution, by running:

$ sudo dnf copr enable twann/tblock
$ sudo dnf install tblock

Or:

$ sudo yum copr enable twann/tblock
$ sudo yum install tblock

On Arch Linux

You can easily install TBlock on any Arch-based Linux distribution, by running:

$ yay -S tblock

Or:

$ paru -S tblock

Or:

$ git clone https://aur.archlinux.org/tblock.git
$ cd tblock
$ makepkg -si

If you have the chaotic-AUR repository enabled, you can as well run:

$ sudo pacman -Syu tblock

On Windows

You can install TBlock on Windows by using the scoop package manager.

> scoop bucket add tblock https://codeberg.org/tblock/bucket
> scoop install tblock/tblock

You can also download a TBlock installer for Windows*, which will install pre-compiled binaries on your machine.

*Please keep in mind that Windows is a proprietary and horrible operating system developed by an awful, sexist and capitalist company that exploits children and that destroys our environment. More than that, TBlock cannot fully protect you against Micro$oft massive data collection and their invasing telemetry system. If you are looking for an ethical, free (as in freedom, as in price, and as in free-of-telemetry), and open-source alternative to Windows, you could use a Linux distribution (also called a GNU/Linux distribution).

On MacOS

You can install TBlock on MacOS, by using the brew package manager:

$ brew tap tblock/tap https://codeberg.org/tblock/homebrew-tap
$ brew install tblock

If, after the installation, you get the following error:

$ sudo tblock -Uy
sudo: tblock: command not found

You need to run the following command:

$ echo 'alias sudo="PATH=$PATH:$(brew --prefix)/bin:$(brew --prefix)/sbin sudo"' >> ~/.bashrc

Inside a virtual environment

Sometimes you need to install a program inside a virtual environment, which means it is not installed on your whole system.
To install TBlock inside a virtual environment, follow the steps below.

1. Setup the virtual environment

$ virtualenv venv

2. Enter the virtual environment

$ source venv/bin/activate

3. Install TBlock

$ pip install tblock

Build it manually

You can also manually build TBlock from source. To do so, follow the instructions above:

1. Clone the Git repository

$ git clone https://codeberg.org/tblock/tblock.git

2. Enter the directory

$ cd tblock

3. Build TBlock and its files

$ make

4. Install TBlock on your machine

$ sudo make install

After installing

After installing, you need to sync the remote filter repository with the local one, in order to be able to subscribe to filters. Also, TBlock is useless without any filter. You need to subscribe to at least one filter in order to block ads.

To do that, simply run:

$ sudo tblock -Sy tblock-base

After installing on Windows

Windows doesn't usually let the hosts file being modified. It will therefore detect TBlock as a malware.
The first time TBlock will try to edit the hosts file, it will probably get restricted by Windows Defender. To allow TBlock to edit the hosts file, do the following:

1. Open Windows Defender settings

Step 1

2. Click on the threat and check "Allow on device", then click on "Start actions"

Step 2

3. As you can see below, the "Threat or app has been allowed and will not be remediated in the future". That means TBlock is now able to work.

Step 3