Skip to content

Instantly share code, notes, and snippets.

@1nikolas
Created December 26, 2022 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1nikolas/0bb66b767e50108b112a9ffdea9cf149 to your computer and use it in GitHub Desktop.
Save 1nikolas/0bb66b767e50108b112a9ffdea9cf149 to your computer and use it in GitHub Desktop.
Install Squid 3.3.8 on newer Ubuntu versions (Tested on Bionic/18.04)
#!/bin/bash
#Ask for password if necessary
sudo echo
#Add Trusty Sources
sudo touch /etc/apt/sources.list.d/trusty_sources.list
echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty main universe" | sudo tee --append /etc/apt/sources.list.d/trusty_sources.list > /dev/null
#Update
sudo apt update
#Install Squid
sudo apt install -y squid3=3.3.8-1ubuntu6 squid=3.3.8-1ubuntu6 squid3-common=3.3.8-1ubuntu6
#Install missing init.d script
wget https://gist.githubusercontent.com/1nikolas/36b31066dc983928939a0ce80b57072d/raw/521e039a531574ec9884a969d81c50c40fea4ffa/squid3
sudo cp squid3 /etc/init.d/
sudo chmod +x /etc/init.d/squid3
sudo update-rc.d squid3 defaults
#Start squid
sudo service squid3 start
#Cleanup
rm squid3
#Print info
clear
echo "====================================="
echo "Squid 3.3.8 is successfully installed!"
echo "Squid's config is located at '/etc/squid3/squid.conf'"
echo "You can start/stop/restart squid by using 'sudo service squid3 start/stop/restart'"
echo "====================================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment