How to install Berkeley DB 4.8 on Linux? The Unix build notes do not show how to install version 4.8 apart from saying 


  BerkeleyDB is required for the wallet. Ubuntu and Debian have their 
      own libdb-dev and libdb++-dev packages, but these will install 
      BerkeleyDB 5.1 or later. This will break binary wallet compatibility 
      with the distributed executables, which are based on BerkeleyDB 4.8.If you do not care about wallet compatibility, pass --with-incompatible-bdb to configure. Otherwise, you can build from self-compiled depends (see above).


The referenced README.md from the quoted 


  Now, you can either build from self-compiled depends or install the
  required dependencies:


does not discuss BerkeleyDB 4.8.

I know there is ./contrib/install_db4.sh in the source for installing BerkeleyDB 4.8 but it abords on my Ubuntu with curl: (7) Failed to connect to git.savannah.gnu.org port 443: No route to host.
You can compile it using this script in the Bitcoin Core repository:
https://github.com/bitcoin/bitcoin/blob/master/contrib/install_db4.sh . It will give you instructions about how to then ./configure with this compiled version in order to build the project.
Instructions about building Bitcoin Core are available in the /doc folder, for Unix systems it is at
https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md