sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
This repository is not found
Err:15 http://ppa.launchpad.net/bitcoin/bitcoin/ubuntu disco Release
404 Not Found [IP: 91.189.95.83 80]
So you can try this method
wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
unzip db-4.8.30.zip
cd db-4.8.30
cd build_unix/
../dist/configure --prefix=/usr/local --enable-cxx
make
make install
Also commonly fixes :
libdb_cxx headers missing Ubuntu
found berkeley db other than 4.8, required for portable wallets
berkeley db 4.8 Ubuntu
reference