The documentation for installing the debian package suggests running:
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
We added this to our chef scripts and this of course runs a lot and ends up appending the same line over and over again. This slows down apt-get operations to the point where it is unusable. When I checked the file it had 500 lines already.
I would suggest changing this to
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt
/sources.list.d/elastic-7.x.list
without the -a. or to
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" > /etc/apt/sources.list.d/elastic-7.x.list