Installation

Upgrading Splunk by untarring to a custom directory name?

the_wolverine
Champion

I'm sure there is a simple way to do this but I can't figure it out. I need to upgrade Splunk using the .tgz and the only way I know how to do it won't allow me to upgrade over my existing install.

My current install is /opt/splunk1/

tar xvfz splunk-4.* -C /opt/splunk1/ creates a new splunk directory in /opt/splunk1/splunk/

What's the best way to do this?

Tags (2)
1 Solution

ziegfried
Influencer

There is a more elegant approach for sure, but you could simple extract into a temporary folder rename the root directory, re-pack it into a .tgz and extract that one.

$ cd /tmp
$ tar xzvf /path/to/splunk-4.3.1-something.tgz
$ mv splunk splunk1
$ tar cvfz /opt/splunk1.tgz splunk1
$ cd /opt
$ tar xzvf splunk1.tgz

View solution in original post

MHibbin
Influencer

The following would probably work... but I would test it first! (as with most things I suppose 🙂 , but it worked on ym quick test)

tar --strip-components=1 -zxvf splunk-*.tgz -C foo/ (where splunk-*.tgz would be your splunk tgz file and foo/ would be your desired location).

Regards,

MHibbin

ziegfried
Influencer

There is a more elegant approach for sure, but you could simple extract into a temporary folder rename the root directory, re-pack it into a .tgz and extract that one.

$ cd /tmp
$ tar xzvf /path/to/splunk-4.3.1-something.tgz
$ mv splunk splunk1
$ tar cvfz /opt/splunk1.tgz splunk1
$ cd /opt
$ tar xzvf splunk1.tgz
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...