Your support on Ko-Fi is much appreciated:
Recommended RHCSA book:
📔 Amazon AU: https://amzn.to/2X5FL98
Buy CSG Merchandise:
More information on Sophos Home Antivirus:
More information about Hostinger VPS:
👉 http://bit.ly/H-VPS
Join our new discord channel:
👉 https://discord.gg/kBQ6Jry
This video is based on RHEL 8. Video to cover the section ‘Install and update software packages from Red Hat Network, a remote repository, or from the local file system’ for the RHCSA (Red Hat Certified System Administrator).
More information on the required learning: http://bit.ly/rhcsa8
Notes from the video:
Some people who have worked with Red Hat previously will be familiar with YUM, however as of RHEL8 it has been replaced by DNF, best to use this going forward even though the yum commands still work.
To search for a package: # dnf search nano
# dnf list na*
To list both enabled and disabled repositories use the following command. A status column is added to the output list to show which of the repositories are enabled.
# dnf repolist all
# dnf repoinfo
To view more information about a particular package:# dnf info nano
To install packages using dnf:
# dnf install nano
To remove a package:
# dnf remove nano
To find out what package provides a particular file:
# dnf provides "*/bin/nano"
To use dnf to install a local package use:
# dnf localinstall rpm
To list all the available package groups:
# dnf groups list
To install a package group:# dnf group install "System Tools"Â
To remove a package group:# dnf group remove "System Tools"Â
To list all of the actions completed using dnf:# dnf history list
To undo a particular action:
# dnf history undo 4
To redo a particular action:
# dnf history redo 4Â
To add a new repository on the system you need the following configuration as a minimum this would need to be in an existing or new file within /etc/yum.repos.d/ with the .repo extension:[repository]
name=repository_name
baseurl=repository_url
Replace repository_url with a URL to the directory where the repodata directory of a repository is located:
* If the repository is available over HTTP, use: http://path/to/repo
* If the repository is available over FTP, use: ftp://path/to/repo
* If the repository is local to the machine, use: file:///path/to/local/repo
There is an automated tool to do the addition of repositories, yum-config-manager which is provided as part of dnf-utils. To install run:
# dnf install dnf-utils
To add an exsiting repository to the system use the following command:# yum-config-manager --add-repo repository_url
To disable a repository:
# yum-config-manager --disablerepo repository
To enable a repository:
# yum-config-manager --enablerepo repository
Creating your own local repository, you need to firstly install the createrepo application:
# dnf install createrepo
2. Copy all packages that you want to have in your repository into one directory, such as /root/local_repo.Â
3. Change to this directory and run the following command:Â # createrepo --database /root/local_repo
To then add the repo to dnf:
# yum-config-manager --add-repo file:///root/local_repo/