Linux Day-3
Package Management in Linux:
- Package management is a method of installing, updating**,** removing, and keeping track of software updates from specific repositories (repos) in the Linux system. Linux distros often use different package management tools such as RPM and Yum.
RPM :
Redhat Package Management
RPM is a default open-source package management utility for RedHat-based systems like (RHEL, CentOS and Fedora). The tool allows system administrators and users to install, update, uninstall, query, verify and manage system software packages in Unix/Linux operating systems. The RPM was formerly known as a **.**rpm file.
# rpm -q -a q= query , a= all.
It will list down all installed software in the OS.
#rpm -q firefox
#rpm -q -l firefox l= longlist.
#rpm -q -i firefox i= information
#rpm -e firefox e= erase/uninstall
**When we try to install Firefox with #rpm -i Firefox in a newly installed OS, we get this error message. [root@localhost ~]# rpm -i Firefox
error: open of Firefox failed: No such file or directory.
To install any software we need the RHEL iOS image file which we use to install OS in a virtual box. We have attached an iOS image in a virtual box.
Open virtual box > Devices > Optical Drivers > choose/create a disk image. Once added go to Files > RHEL ios (left side) > Appstreams > Packages. Open Packages and double-click on the software you want to install.
We can perform the same through the command line.
#df Copy the RHEL ios file path
#cd path
#ls
#cd Appstream/
#cd packages/
#rpm -i firefox.... i= install - Normal installation
#rpm -i -v firefox.... v= verbose -shows background process
#rpm -ivh firefox... installation progress hash
** Take Screenshots in Linux: We use the gnome command to take screenshots in Linux.
#gnome-screenshot - take screenshot
#which gnome-screenshot - Where it located.
#gnome-screenshot -f /root/folder1/s1.png - save screenshot on specific location
#gnome-screenshot -f /root/folder1/ new.png --delay=20 - Screenshot after 20 sec
** Special Notes:
ctrl+s = it will hide the command you type on terminal
ctrl+q = To check all hidden commands output.
YUM:
Yellowdog Updated Modified.
YUM is an open-source command line as well as a graphical-based package management tool for RPM-based Linux systems.
It allows users and system administrators to easily install, update, remove or search software packages on a system.
YUM relies on an online repository for installing packages.
Before using the yum command, need to enable the repositories in /etc/yum.repos.d . This is a one-time task before using yum the first time.
When we try to use the yum command without enabling repositories.
#df - Here copy the RHEL iso image path
#cd /etc/yum.repos.d/
#gedit mydvd.repo
Save the above entry on Notepad.
#yum install httpd
#yum remove httpd - to uninstall the program with dependencies.
#dnf install httpd - dnf also use to install software faster than yum.
#yum update httpd - to update any software.
#yum list httpd - Use the list function to search for the specific package with a name
#yum info firefox
Will continue more yum commands in next blog.
Thank you🙏