# Build rpm package with ES source file elasticsearch-8.12.1-linux-x86\_64.tar.gz file excluding jdk , so that I can reduce its size

**URL:** <https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429>\
**Category:** Elasticsearch\
**Created:** [March 14, 2024, 4:58pm UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429 "2024-03-14T16:58:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Varinder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varinder/32/123243_2.png) [@Varinder](https://discuss.elastic.co/u/Varinder)\
**Post date:** [March 14, 2024, 4:58pm UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/1 "2024-03-14T16:58:20Z")

</div>

I have downloaded ES source file elasticsearch-8.12.1-linux-x86\_64.tar.gz file which has all binaries, libraries, jdk and Modules etcetera.

I have tried to build rpm package I am getting error .

I am following this link to build rpm package.  
[https://rogerwelin.github.io/rpm/rpmbuild/elasticsearch/2015/04/22/rpmbuild-tutorial-elasticsearch-part-2.html](https://rogerwelin.github.io/rpm/rpmbuild/elasticsearch/2015/04/22/rpmbuild-tutorial-elasticsearch-part-2.html)

Eventually It was showing in ERROR scrn shot that java and binaries are not installed , I have installed everything before running rpm. still getting error.

Sorry for typos !!

 ![RPM_build](https://us1.discourse-cdn.com/elastic/original/3X/1/5/1503cf892a7e55d44ba4dcd0c226c420b131c0b9.png)  
 ![Screenshot 2024-03-13 141213](https://us1.discourse-cdn.com/elastic/original/3X/a/d/ad47c2926a404aacc801e712d9b31e0ea6a58171.png)  
 ![rpm_without_Java_370mb](https://us1.discourse-cdn.com/elastic/original/3X/5/a/5a2186a3e97c65e3cdfe1f67a7634ffebe3bd3e2.png)  
 ![Screenshot 2024-03-13 105248](https://us1.discourse-cdn.com/elastic/original/3X/2/b/2ba24042c2bf71c271da873584b8a985effe94be.png)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2024, 6:11pm UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/2 "2024-03-14T18:11:41Z")

</div>

Please don't post images of text as they are hard to read, may not display correctly for everyone, and are not searchable.

Instead, paste the text and format it with `</>` icon or pairs of triple backticks (```), and check the preview window to make sure it's properly formatted before posting it. This makes it more likely that your question will receive a useful answer.

It would be great if you could update your post to solve this.

Apparently it's missing a dependency?

> I have downloaded ES source file elasticsearch-8.12.1-linux-x86\_64.tar.gz file which has all binaries, libraries, jdk and Modules etcetera.

> [@Varinder](#):
>
> I am following this link to build rpm package.  
> [rpmbuild tutorial - Elasticsearch source rpm](https://rogerwelin.github.io/rpm/rpmbuild/elasticsearch/2015/04/22/rpmbuild-tutorial-elasticsearch-part-2.html)

This is 9 years old. I doubt you can follow that guide.

---

<div class="post-metadata">

**Author:** ![Varinder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varinder/32/123243_2.png) [@Varinder](https://discuss.elastic.co/u/Varinder)\
**Post date:** [March 15, 2024, 2:48am UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/3 "2024-03-15T02:48:15Z")

</div>

Thanks for the feedback Sir. Next time I will post in text form. Now I cant as I only had screenshots.

1. For missing dependency. I have deleted jdk for purpose. Thats what I want so that rpm package created would be of small size( less than 500mb) .
2. For missing dependency, I have installed missing dependencies separately , before installing ES with rpm package. But its still showing error.  
3 . For old link I will definitely search.

Thanks once again.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 15, 2024, 3:48am UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/4 "2024-03-15T03:48:56Z")

</div>

But why do you want to reduce the size of the RPM?

May be you should clone the GitHub repository and change the way it's built? Or just build the project and get from there the artifacts you need?  
The zip distribution might be the best place to start?

---

<div class="post-metadata">

**Author:** ![Varinder](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/varinder/32/123243_2.png) [@Varinder](https://discuss.elastic.co/u/Varinder)\
**Post date:** [March 15, 2024, 4:03am UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/5 "2024-03-15T04:03:34Z")

</div>

Ist reason, ES8.12.1's rpm file has ES and java together. I want to install them separately. Means building ES rpm package without java only.  
2nd, I want to push 590Mb of rpm file to github ( this I cant avoid as its company policy) . When I use git pull 590 Mb file crashes.

For two reasons I want to build rpm package without jdk , ES only .

Before this, in ES6 version both ES and java were separate so there was no issue.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 15, 2024, 8:51am UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/6 "2024-03-15T08:51:32Z")

</div>

> [@Varinder](#):
>
> For two reasons I want to build rpm package without jdk , ES only .

I'd build it from the source and start here:

> <https://github.com/elastic/elasticsearch/blob/48a287ab9497e852de30327444b0809e55d46466/distribution/packages/build.gradle#L148>

---

<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:** [April 12, 2024, 8:52am UTC](https://discuss.elastic.co/t/build-rpm-package-with-es-source-file-elasticsearch-8-12-1-linux-x86-64-tar-gz-file-excluding-jdk-so-that-i-can-reduce-its-size/355429/7 "2024-04-12T08:52:23Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
