[Solved] Unable to install dependencies for the synapse

I have tried to fresh install synapse. Though I have old backup which I want to restore to bring back my old rooms and chat. But both fresh install and restore is failing because of the dependencies error.

I tried to install the dependencies manually but it is failing too.

apt-get install coturn build-essential python3-dev libffi-dev python3-pip python3-setuptools sqlite3 libssl-dev python3-venv libxml2-dev libxslt1-dev python3-lxml libjpeg-dev libpq-dev postgresql acl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libjpeg-dev is a virtual package provided by:
  libjpeg62-turbo-dev 1:1.5.1-2 [Not candidate version]

Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

N: Ignoring file 'debian-testing.list.back' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
E: Package 'python3-pip' has no installation candidate
E: Package 'libjpeg-dev' has no installation candidate

I hate the package mess ups. Ant solutions?

:scream:

You need to disable some unstable repositories or?

Is there a easy way to restore to stable?