PHP Composer - Downloading Repository Times Out on Update/Install
I was having problems getting
composer install to run. It kept hanging on "Loading repositories with package information." I tried to download the package list manually using wget as a test, and it hung as well:
$ wget https://repo.packagist.org/packages.json --2019-01-13 13:04:50-- https://repo.packagist.org/packages.json Resolving repo.packagist.org (repo.packagist.org)... 2607:5300:201:2100::7:2273, 184.108.40.206 Connecting to repo.packagist.org (repo.packagist.org)|2607:5300:201:2100::7:2273|:443...
The issue has to do with the routing for the IPv6 address of repo.packagist.org being broken, as noted in this GitHub issue.
I tried disabling IPv6 in Fedora's Network Manager, but for some reason, I was still getting an IPv6 address on the interface. I solved this problem using a temporary method suggested in the comments of the issue above by manually adding the IPv4 address of repo.packagist.org to the hosts file on my machine:
# dig +short repo.packagist.org 220.127.116.11 # echo "18.104.22.168 repo.packagist.org" >> /etc/hosts