Step 3: Build Squid 4ΒΆ
In order to get Squid 4 on Ubuntu 18.04 LTS we will use the original version from Debian Unstable Repository with several additions necessary for SSL Bump and HTTPS filtering. Run script 03_build_squid.sh to do the compilation.
#!/bin/bash
if [[ $EUID -eq 0 ]]; then
echo "This script must NOT be run as root" 1>&2
exit 1
fi
# drop squid build folder
rm -R build/squid
# we will be working in a subfolder make it
mkdir -p build/squid
# set squid version
source squid.ver
# copy the patch
cp control.patch build/squid/
# decend into working directory
pushd build/squid
# get squid from debian experimental
wget http://http.debian.net/debian/pool/main/s/squid/squid_${SQUID_PKG}.dsc
wget http://http.debian.net/debian/pool/main/s/squid/squid_${SQUID_VER}.orig.tar.xz
wget http://http.debian.net/debian/pool/main/s/squid/squid_${SQUID_VER}.orig.tar.xz.asc
wget http://http.debian.net/debian/pool/main/s/squid/squid_${SQUID_PKG}.debian.tar.xz
# unpack the source package
dpkg-source -x squid_${SQUID_PKG}.dsc
# patch the control file
patch squid-${SQUID_VER}/debian/control < control.patch
# build the package
cd squid-${SQUID_VER} && dpkg-buildpackage -rfakeroot -b -us -uc
# and revert
popd
Control patch file remove dependencies on tools not present in Ubuntu 18.04.
--- control 2021-02-07 20:58:30.000000000 +0000
+++ control.new 2021-02-27 07:07:06.471623269 +0000
@@ -11,7 +11,7 @@
# The compiler dependencies are relevant for backporting.
, g++ (>= 4.9) <!cross> | clang (>= 3.7) <!cross>
, gcc (>= 4.9) <!cross> | clang (>= 3.7) <!cross>
- , debhelper (>=12), dpkg-dev (>= 1.17.11~), lsb-release
+ , debhelper (>=11), dpkg-dev (>= 1.17.11~), lsb-release
, dh-apparmor
, libcppunit-dev
, libcap2-dev [linux-any]
squid.ver file is just to easier manage Squid versions in script.
#!/usr/bin/env bash
# set squid version
SQUID_VER="4.13"
SQUID_PKG="${SQUID_VER}-5"
After build is successful, run script 04_install_squid.sh to install Squid.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# set squid version
source squid.ver
# decend into working directory
pushd build/squid
# install squid packages
sudo apt-get install squid-langpack
dpkg --install squid-common_${SQUID_PKG}_all.deb
dpkg --install squid-openssl_${SQUID_PKG}_amd64.deb
dpkg --install squidclient_${SQUID_PKG}_amd64.deb
# and revert
popd
# verify the installed squid binary
systemctl stop squid && systemctl start squid && systemctl status squid && /usr/sbin/squid -v