Skip to content

Commit f3d7130

Browse files
Update vm-applications.md
Putting ubuntu tab first
1 parent 7b0ecff commit f3d7130

File tree

1 file changed

+72
-72
lines changed

1 file changed

+72
-72
lines changed

articles/virtual-machines/vm-applications.md

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -158,78 +158,6 @@ You can download individual packages for platform specific package managers, but
158158

159159
Figuring out the dependencies can be a bit tricky. There are third party tools that can show you the entire dependency tree.
160160

161-
# [Red Hat](#tab/rhel)
162-
163-
In Red Hat, you can run `sudo yum deplist <package_name>` to show all the packages that will be installed when executing the `sudo yum install <package_name>` command. Then you can use that output to download all .rpm files to create an archive that can be used as the application package.
164-
165-
1. Example, to create a VM application package to install PowerShell for Red Hat, first run the following commands to enable the repository where PowerShell can be downloaded from and also to identify the package dependencies on a new RHEL VM.
166-
167-
- RHEL 7:
168-
169-
```bash
170-
# Register the Microsoft RedHat repository
171-
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
172-
173-
sudo yum deplist powershell
174-
```
175-
176-
- RHEL 8:
177-
178-
```bash
179-
# Register the Microsoft RedHat repository
180-
curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
181-
182-
sudo dnf deplist powershell
183-
```
184-
185-
2. Check the output of each of the dependency lines which lists the dependency packages as `provider`:
186-
187-
```output
188-
dependency: /bin/sh
189-
provider: bash.x86_64 4.2.46-35.el7_9
190-
dependency: libicu
191-
provider: libicu.x86_64 50.2-4.el7_7
192-
provider: libicu.i686 50.2-4.el7_7
193-
dependency: openssl-libs
194-
provider: openssl-libs.x86_64 1:1.0.2k-26.el7_9
195-
provider: openssl-libs.i686 1:1.0.2k-26.el7_9
196-
```
197-
198-
3. Download each of these files using `sudo yum install --downloadonly <package_name>`, to download a package when is not yet installed in the system, or `sudo yum reinstall --downloadonly <package_name>`, to download a package that's already installed in the system, and create a tar compressed archive with all files.
199-
200-
201-
```bash
202-
mkdir /tmp/powershell
203-
cd /tmp/powershell
204-
sudo yum reinstall --downloadonly --downloaddir=/tmp/powershell bash
205-
sudo yum reinstall --downloadonly --downloaddir=/tmp/powershell libicu
206-
sudo yum reinstall --downloadonly --downloaddir=/tmp/powershell openssl-libs
207-
sudo yum install --downloadonly --downloaddir=/tmp/powershell powershell
208-
sudo tar -cvzf powershell.tar.gz *.rpm
209-
```
210-
211-
4. This tar archive will be the application package file.
212-
213-
- The install command in this case is:
214-
215-
```bash
216-
sudo tar -xvzf powershell.tar.gz && sudo yum install *.rpm -y
217-
```
218-
219-
- And the remove command is:
220-
221-
```bash
222-
sudo yum remove powershell
223-
```
224-
225-
In case you don't want to resolve the dependencies yourself and yum/dnf is able to connect to the repositories, you can install an application with just one .rpm file and let yum/dnf handle the dependencies.
226-
227-
Example install command:
228-
229-
```bash
230-
yum install <package.rpm> -y
231-
```
232-
233161
# [Ubuntu](#tab/ubuntu)
234162

235163
In Ubuntu, you can run `sudo apt show <package_name> | grep Depends` to show all the packages that will be installed when executing the `sudo apt-get install <packge_name>` command. Then you can use that output to download all .deb files to create an archive that can be used as the application package.
@@ -326,6 +254,78 @@ Example install command:
326254
dpkg -i <package_name> || apt --fix-broken install -y
327255
```
328256

257+
# [Red Hat](#tab/rhel)
258+
259+
In Red Hat, you can run `sudo yum deplist <package_name>` to show all the packages that will be installed when executing the `sudo yum install <package_name>` command. Then you can use that output to download all .rpm files to create an archive that can be used as the application package.
260+
261+
1. Example, to create a VM application package to install PowerShell for Red Hat, first run the following commands to enable the repository where PowerShell can be downloaded from and also to identify the package dependencies on a new RHEL VM.
262+
263+
- RHEL 7:
264+
265+
```bash
266+
# Register the Microsoft RedHat repository
267+
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
268+
269+
sudo yum deplist powershell
270+
```
271+
272+
- RHEL 8:
273+
274+
```bash
275+
# Register the Microsoft RedHat repository
276+
curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo
277+
278+
sudo dnf deplist powershell
279+
```
280+
281+
2. Check the output of each of the dependency lines which lists the dependency packages as `provider`:
282+
283+
```output
284+
dependency: /bin/sh
285+
provider: bash.x86_64 4.2.46-35.el7_9
286+
dependency: libicu
287+
provider: libicu.x86_64 50.2-4.el7_7
288+
provider: libicu.i686 50.2-4.el7_7
289+
dependency: openssl-libs
290+
provider: openssl-libs.x86_64 1:1.0.2k-26.el7_9
291+
provider: openssl-libs.i686 1:1.0.2k-26.el7_9
292+
```
293+
294+
3. Download each of these files using `sudo yum install --downloadonly <package_name>`, to download a package when is not yet installed in the system, or `sudo yum reinstall --downloadonly <package_name>`, to download a package that's already installed in the system, and create a tar compressed archive with all files.
295+
296+
297+
```bash
298+
mkdir /tmp/powershell
299+
cd /tmp/powershell
300+
sudo yum reinstall --downloadonly --downloaddir=/tmp/powershell bash
301+
sudo yum reinstall --downloadonly --downloaddir=/tmp/powershell libicu
302+
sudo yum reinstall --downloadonly --downloaddir=/tmp/powershell openssl-libs
303+
sudo yum install --downloadonly --downloaddir=/tmp/powershell powershell
304+
sudo tar -cvzf powershell.tar.gz *.rpm
305+
```
306+
307+
4. This tar archive will be the application package file.
308+
309+
- The install command in this case is:
310+
311+
```bash
312+
sudo tar -xvzf powershell.tar.gz && sudo yum install *.rpm -y
313+
```
314+
315+
- And the remove command is:
316+
317+
```bash
318+
sudo yum remove powershell
319+
```
320+
321+
In case you don't want to resolve the dependencies yourself and yum/dnf is able to connect to the repositories, you can install an application with just one .rpm file and let yum/dnf handle the dependencies.
322+
323+
Example install command:
324+
325+
```bash
326+
yum install <package.rpm> -y
327+
```
328+
329329
# [SUSE](#tab/sles)
330330

331331
In SUSE, you can run `sudo zypper info --requires <package_name>` to show all the packages that will be installed when executing the `sudo zypper install <package_name>` command. Then you can use that output to download all .rpm files to create an archive that can be used as the application package.

0 commit comments

Comments
 (0)