Ubuntu – sudo add-apt-repository hangs

18.04add-apt-repositoryaptjava

I am running
sudo add-apt-repository ppa:webupd8team/java in order to add the repository to install oracle jdk on my Ubuntu 18.4 machine. The command hangs and does not return. As far as I understand all this command does is to add the repository to the /etc/apt/sources.list file. Could the reason for the command hanging be that i am running this behind a proxy?

How can I resolve this issue?

Best Answer

I have followed this instructions, and it worked great for me (Ubuntu 20.04).

In command line, type this

sudo gedit /etc/gai.conf

Then, edit this line by removing the #

precedence ::ffff:0:0/96  100
Related Question