In this hands-on lab, we will be using Zypper to manage software and repositories. We will download a package and make a local repository and then install from that repository.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Query for the Package `nginx`, and Then Use Zypper to Download the Package but Do Not Install It
Run the command:
sudo zypper se nginx
Answer
no
to the question.Make note of the package name, and then download the package:
sudo zypper in -d nginx
Answer
y
to download the package.
- Create a New Zypper Repo at `/home/cloud_user/localrepo`, Name It `localrepo`, Copy the Docker Package to It, Refresh It, Install Nginx from It, and Verify the Package’s Source
Get the name of the
nginx
package so we can find it in the cache directory:zypper info nginx
Create the folder for the
localrepo
:mkdir ~/localrepo
Copy the RPM file to the
localrepo
directory:cp -r /var/cache/zypp/packages/Server_Applications_Module_x86_64:SLE-Module-Server-Applications15-SP1-Updates/x86_64 ./localrepo
Add the repository and refresh it:
sudo zypper ar /home/cloud_user/localrepo/x86_64/ localrepo sudo zypper refresh
Install Nginx from the
localrepo
:sudo zypper in localrepo:nginx
Answer
y
to the question.Verify the installed Nginx came from the local repo:
sudo zypper info nginx
- Start Nginx, Verify It Works, Stop It, and Remove It
Start Nginx:
sudo systemctl start nginx
Verify it works (a page should load, even if it is an error):
curl 127.0.0.1
Stop Nginx:
sudo systemctl stop nginx
Remove Nginx:
sudo zypper rm nginx
Answer
y
to remove the package.