Skip to content

Commit 121a7f5

Browse files
authored
Corrects use of autorefresh option (#2712)
The author of #1745 is correct, `autorefresh = 1` is not a config option that's available in dnf or yum. However, it is a valid and often used option in [zypper](https://doc.opensuse.org/documentation/tumbleweed/zypper/) (openSUSE distros). I've added tabs to account for this discrepancy (when creating the repo definition) and using tabs actually fixes the next step as well, which is trying to account for multiple Linux distros commands to install Elasticsearch from an RPM repo. The RHEL-based commands for installing will also differ based on the version or RHEL you're using, so that tab accounts for RHEL 8 + (when dnf was introduced) and RHEL 7 & earlier for yum. I've also updated the names of the distros for accuracy: * Red Hat Enterprise Linux (RHEL) * openSUSE * SUSE Linux Enterprise Server (SLES) * Oracle Linux (was renamed from Oracle Enterprise) * CentOS Fixes #1745
1 parent 9ceeae4 commit 121a7f5

File tree

1 file changed

+50
-10
lines changed

1 file changed

+50
-10
lines changed

deploy-manage/deploy/self-managed/install-elasticsearch-with-rpm.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ sub:
1717

1818
# Install {{es}} with RPM [rpm]
1919

20-
The RPM package for {{es}} can be [downloaded from our website](#install-rpm) or from our [RPM repository](#rpm-repo). It can be used to install {{es}} on any RPM-based system such as OpenSuSE, SLES, Centos, Red Hat, and Oracle Enterprise.
20+
The RPM package for {{es}} can be [downloaded from our website](#install-rpm) or from our [RPM repository](#rpm-repo). It can be used to install {{es}} on any RPM-based system such as openSUSE, SUSE Linux Enterprise Server (SLES), CentOS, Red Hat Enterprise Linux (RHEL), and Oracle Linux.
2121

2222
::::{note}
2323
RPM install is not supported on distributions with old versions of RPM, such as SLES 11 and CentOS 5. Refer to [Install {{es}} from archive on Linux or MacOS](install-elasticsearch-from-archive-on-linux-macos.md) instead.
@@ -48,14 +48,35 @@ rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
4848

4949
## Step 2: Install {{es}}
5050

51-
You have several options for installing the {{es}} RPM package:
51+
You have two options for installing the {{es}} RPM package:
5252

5353
* [From the RPM repository](#rpm-repo)
5454
* [Manually](#install-rpm)
5555

5656
### Install from the RPM repository [rpm-repo]
5757

58-
Create a file called `elasticsearch.repo` in the `/etc/yum.repos.d/` directory for RedHat based distributions, or in the `/etc/zypp/repos.d/` directory for OpenSuSE based distributions, containing:
58+
1. Define a repository for {{es}}.
59+
60+
::::{tab-set}
61+
:group:linux-distros
62+
:::{tab-item} RedHat distributions
63+
:sync: rhel
64+
For RedHat based distributions, create a file called `elasticsearch.repo` in the `/etc/yum.repos.d/` directory and include the following configuration:
65+
66+
```ini subs=true
67+
[elasticsearch]
68+
name={{es}} repository for 9.x packages
69+
baseurl=https://artifacts.elastic.co/packages/9.x/yum
70+
gpgcheck=1
71+
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
72+
enabled=0
73+
type=rpm-md
74+
```
75+
:::
76+
77+
:::{tab-item} openSUSE distributions
78+
:sync: suse
79+
For openSUSE based distributions, create a file called `elasticsearch.repo` in the `/etc/zypp/repos.d/` directory and include the following configuration:
5980

6081
```ini subs=true
6182
[elasticsearch]
@@ -67,19 +88,38 @@ enabled=0
6788
autorefresh=1
6889
type=rpm-md
6990
```
70-
And your repository is ready for use. You can now install {{es}} with one of the following commands:
91+
:::
92+
::::
93+
94+
2. Install {{es}} from the repository you defined earlier.
95+
96+
::::{tab-set}
97+
:group:linux-distros
98+
:::{tab-item} RedHat distributions
99+
:sync: rhel
100+
If you use Fedora, or Red Hat Enterprise Linux 8 and later, enter the following command:
101+
102+
```sh
103+
sudo dnf install --enablerepo=elasticsearch elasticsearch
104+
```
105+
106+
If you use CentOS, or Red Hat Enterprise Linux 7 and earlier, enter the following command:
107+
```sh
108+
sudo yum install --enablerepo=elasticsearch elasticsearch
109+
```
110+
:::
111+
:::{tab-item} openSUSE distributions
112+
:sync: suse
113+
Enter the following command:
71114

72115
```sh
73-
sudo yum install --enablerepo=elasticsearch elasticsearch <1>
74-
sudo dnf install --enablerepo=elasticsearch elasticsearch <2>
75116
sudo zypper modifyrepo --enable elasticsearch && \
76117
sudo zypper install elasticsearch; \
77-
sudo zypper modifyrepo --disable elasticsearch <3>
118+
sudo zypper modifyrepo --disable elasticsearch
78119
```
120+
:::
121+
::::
79122

80-
1. Use `yum` on CentOS and older Red Hat based distributions.
81-
2. Use `dnf` on Fedora and other newer Red Hat distributions.
82-
3. Use `zypper` on OpenSUSE based distributions.
83123

84124
### Download and install the RPM manually [install-rpm]
85125

0 commit comments

Comments
 (0)