# Installing ElasticSearch on Ubuntu behind an apt-cacher proxy

**URL:** <https://discuss.elastic.co/t/installing-elasticsearch-on-ubuntu-behind-an-apt-cacher-proxy/1125>\
**Category:** Elasticsearch\
**Created:** [May 21, 2015, 6:20pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-on-ubuntu-behind-an-apt-cacher-proxy/1125 "2015-05-21T18:20:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirkibbar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amirkibbar/32/44795_2.png) [@amirkibbar](https://discuss.elastic.co/u/amirkibbar)\
**Post date:** [May 21, 2015, 6:20pm UTC](https://discuss.elastic.co/t/installing-elasticsearch-on-ubuntu-behind-an-apt-cacher-proxy/1125/1 "2015-05-21T18:20:52Z")

</div>

My setup requires an apt-cacher as a proxy between the box on which I have ELK installed and the internet. I ran into a problem installing Elasticsearch from the public apt repository. The problem was:

> E: Failed to fetch [http://packages.elastic.co/elasticsearch/1.5/debian/pool/main/e/elasticsearch/elasticsearch-1.5.2.deb](http://packages.elastic.co/elasticsearch/1.5/debian/pool/main/e/elasticsearch/elasticsearch-1.5.2.deb) 403 Sorry, not allowed to fetch that type of file: elasticsearch-1.5.2.deb

Googling this problem did not result in anything meaningful, but I did find a solution. The solution I found was to change the apt-cacher configuration - it has a filter on package names in a perl regular expression, I relaxed its default a little bit to allow the elasticsearch-1.5.2.deb package to go through.

The configuration is in /etc/apt-cacher/apt-cacher.conf, to fix it you need to add the following:

> package\_files\_regexp = (?:\[1\]+[_]\*(?:\d:)?[-+.~a-zA-Z0-9]+(?:[_]_[-a-z0-9]_.(?:u|d)?deb|.dsc|.tar(?:.gz|.bz2|.xz)|.diff.gz)|.rpm|index.db-.+.gz|.jigdo|.template)$

I thought I'd share this - it might help someone.

Amir

* * *

1. -+.a-z0-9

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:12am UTC](https://discuss.elastic.co/t/installing-elasticsearch-on-ubuntu-behind-an-apt-cacher-proxy/1125/2 "2017-07-06T00:12:33Z")

</div>


