Among the traditional tasks to be carried out in Linux environments, in this case CentOS 7 , it is the installation and uninstallation of packages which are useful to increase the use of the server or simply to free up space on the disk ..
In the case of CentOS or RedHat distributions , the yum command is implemented for this type of activities. By default, yum will automatically attempt to verify all configured repositories in order to resolve all package dependencies during an installation and / or update.
It is for this reason that today TechnoWikis will explain how to use this yum (Yellowdog Updater Modified) command in CentOS 7 to manage all processes with packages..
1. How to install a package with Yum command on Linux
To carry out this process, we must use the following syntax:
yum install <package name>
By default, the yum install line will display a message in order to accept or reject the process before installing the packages:
If we want yum to automatically install the package without asking, we must use the -y option as follows:
yum -y install <package name>
With this command you do it.
2. How to uninstall a package with Yum Linux command
At the moment a package is no longer needed, we can uninstall it simply with yum. For this we execute the following syntax:
yum remove <package name>
This will remove the specified packages, along with other packages that depend on the packages to be removed.
3. How to update an existing package with Yum Linux command
The yum command has a function developed to update old packages, for this we must use the following syntax:
yum update <package name>
This parameter is used to update the specified packages to the latest available version, if any, if the package names are not specified, and yum will attempt to update all packages installed in the system.
We can add the --obsoletes option for yum to process obsolete packages, so that packages that are obsolete in the updates will be removed and replaced with the most modern ones.
Within this category we can use the yum check-update command to check if updates are available for installed packages. As a result yum returns a list of all updates of all repositories, in case one is available:
4. How to search for packages with Yum Linux command
In case of not knowing the exact name of the package we wish to install, it will be possible to use yum search “keywordâ€, which will search for all packages that match the keyword entered and display the results:
yum search chrome
This command is used to find any package that contains the specified keyword and will result in some description, summary, packager and package name fields of the RPM in all available repositories..
5. How to display additional information of a package with Yum Linux command
If you wish to obtain more information about a package available with yum, we can execute the following syntax:
yum info <package>
6. How to view all available packages using Linux Yum command
With the following command it will be possible to display a list of all the packages available in the yum database:
yum list | less
7. How to view list of packages installed on the system with Yum Linux command
This is a practical option for control and audit tasks as it allows us to clearly know which packages are installed in the system, for this we execute the following:
yum list installed | less
8. How to know the software groups available with Yum Linux command
In the case of these distributions, some related packages are grouped into a specific group so that instead of searching and installing all the packages individually, which belong to a specific function, just install the group, which will install all the packages that belong to that group.
To do this we execute:
yum grouplist
9. How to validate to which package a file with Yum Linux command belongs
With the following syntax it will be possible to know to which package a particular file belongs, for this we must know its current path:
yum provides / etc / sysconfig / nfs
10. How to install a specific software group with Linux yum command
We have seen the option to deploy the software groups through yum, now, if we want to install all that group we must execute the following:
yum groupinstall 'Group'
11. How to deploy current repositories with Yum Linux command
All yum commands are associated to an official repository or not, if we want to see the enabled repositories we will execute the following:
yum repolist
If we want to visualize all the repositories we will execute:
yum repolist all
12. How to install from a disabled repository with Yum Linux command
With the previous command we have seen that many repositories are disabled, but it will be possible to install elements from any of them, for this, we will use the following syntax:
yum --enablerepo = fedora-source install vim-X11.x86_64
As we can see, with this command the installation is carried out from a disabled repository.
13. How to execute Yum command interactively using Shell on Linux
Yum offers us an interactive shell to execute several commands simultaneously, for this we must execute:
yum shell
In the terminal we will enter the commands to use as appropriate:
14. How to update an existing group with Yum Linux command
To update an existing software group we must execute the following:
yum groupupdate 'Group'
15. How to uninstall a software group with Yum Linux command
If more than one software group is not required, we can free up space by deleting it as follows:
yum groupremove 'Group'
In this way the yum command facilitates a complete administration of the available packages.