Package Manager :
A package manager is a software program that is used to manage software in Linux systems. It can download, update, search and delete packages as it deems necessary on the system Every package comes with a metadata which the package manager uses to automate the download and update of a dependency.
There is many different types of package manager for the different distributions of Linux and each type works with it’s format or file type. for example : -> RedHat and Centos uses yum. (YellowDog Updater, modified). -> Kali Linux, ubuntu uses apt (Advanced package threat). -> Arch Linux uses pacman. ->OpenSUSE uses zypper. => Software installation in Linux requires using a Linux distribution’s package manager.
RPM :
->Stands for Redhat Package Manager to install and query packages on a system. ->Package contains an archive of files compress w/cpio, metadata, and dependencies. Might contain scripts, checking that the environment is setup correctly. ->Repo online resource of many packages.
Lemme show you how to use rpm with example :
rpm -ivh <package> -> example : rpm -ivh kernel-3.10.0-862.2.3.el7.x86_64.rpm rpm -Uvh <package> -> example : rpm -Uvh kernel-3.10-862.2.3.el7.x86_64.rpm => "i" for install and "U" for update.
rpm -e <package> -> to delete a package.
rpm -qd <package> -> List the <package>'s man document file. rpm -ql <package> -> List all files in a package. rpm -qc <package> -> List all the configuration files in a package. rpm -qa | grep <package> -> To verify all installed packages. rpm -qp --scripts <package> -> To verify the installation script of a non-installed package. rpm -q --scripts <package> -> To verify the installation script on an installed package.
YUM :
->Stands for (yellowdog updater, modified) and it is an easier package manager tool that resolves dependencies commonly known as “dependency hell” compared to rpm. Let me show you some useful commands :
yum install -y <package> -> example : yum install httpd -y
yum group install <p_group> -> example : yum group install "Smart Card Support".
yum info <package> -> example : yum info nginx (to get more info bout nginx)
yum remove <package> -y -> to remove a <package>
yum check-update kernel || yum update -> to update a package.
yum provides -> deep search about a package.
yum list --all |||| yum search <package> -> list all the packages.
yum list --installed |||| yum list --available
yum config-manager --help ->
yum repolist - all | yum repoinfo
yum history undo | redo <id>
Small lab : Install the previous version of php:7.3. Solution : -> yum module list -> yum module profile php -> yum module install php:7.3
Repository :
A repository or rather, a software repository is a central server where most software/packages are stored. take Play Store as an example. Now lets try to setup a local repository. To do so, follow my steps :
Insert the disk and then type : dd if=/dev/sr0 of=/rhel8.iso bs=1M
Create a mount point and then mount it on fstab
1. mkdir repo 2. echo "/rhel8.iso /repo iso9660 defaults 0 0 >> /etc/fstab. 3. mount -a
=> Sometimes you may need to mound the /dev/sr0.dnf config-manager --add-repo <repo_url> OR -> vim /etc/yum.repo.d/BaseOS.repo [BaseOS] name = BaseOS baseurl = ///repo/BaseOS gpgcheck = 0 enabled =1 -> vim /etc/yum.repo.d/AppStream.repo [AppStream] name = AppStream baseurl = ///repo/AppStream gpgcheck = 0 enabled =1
yum repolist
Let me explain what I've wrote under /AppStream.repo and /BaseOS.repo.
[BaseOS] -> This represents a unique repository ID.
name = -> The name field is the name of the repository, It is advisable you give a name you can easily relate to.
baseurl = -> The baseurl is the repository’s URL. That is, the repository location where the packages are in. It can be located on an HTTP, FTP, NFS, etc servers. Examples : FILE (If it is located locally on the system)-> file:///path-to-repo HTTP -> http://url-repo HTTPS (if ssl is configured) -> https://url-repo FTP -> ftp://path-to-repo
enabled = -> The enabled field means you either want to enable or disable a repository. 1 to enable, 0 to disable.
gpgcheck = ->The enabled field means you either want to enable or disable a repository. => HINT : If you are using a local repo make sure to set it to 0 otherwise it will fail.
Last updated