This is the 13th day of my participation in the August More text Challenge. For details, see: August More Text Challenge
A lifelong learner, practitioner, and sharer committed to the path of technology, an original blogger who is busy and sometimes lazy, and a teenager who is occasionally boring and sometimes humorous.
Welcome to search “Jge’s IT Journey” on wechat!
Configure and use the Yum repository on Linux
preface
At present, Linux system is widely used in the long-term and stable operation of web servers, cluster systems that deal with large amounts of data, and environments that require collaborative work.
Compared with Windows, The Linux operating system has the following advantages:
- Stable and efficient;
- Free or at a small cost;
- Few loopholes and quick repair;
- Multi-task multi-user;
- More secure user and file permission policies;
- Embedded system suitable for small kernel programs;
- It’s relatively resource free
1. Common Linux systems
- RedHat Enterprise Linux: RHEL is the most widely used Linux operating system in the world.
- Communicity Enterprise Operating System (CentOS) : A free Linux System recompiled and released by RHEL.
- Fedora: A desktop version of the system suite released by Red Hat.
- OpenSUSE: A well-known German Linux system.
- Gentoo: Extremely customized and complex to operate.
- Debian: Stable, secure, and supports various hardware architectures.
- Ubuntu: Extremely compatible with new hardware.
RPM and Yum software repository
RPM is red Hat’s package manager, similar to the Windows control panel.
Before the release of RPM, software installation in Linux can only be done in source packages, which is time-consuming and laborious.
The dependencies between the software even require the operation colleagues to compile their own code to solve.
The RPM mechanism is designed to address these issues.
Common RPM software package commands
- Install software: RPM -ivh filename.rpm
- Upgrade software: RPM -uvh filenance.rpm
- To uninstall the software, run the RPM -e filename.rpm command
- Example Query software description: RPM -qpi filenance.rpm
- Listing software file information: RPM -qpl filename. RPM
- Example query the filename. RPM: RPM -qf filename
Although RPM can help users query dependencies related to the software, the process is still complex, especially in the case of some large software still needs to be solved by the operation and maintenance colleagues.
The Yum software repository can analyze required software packages and their dependencies based on user requirements, and automatically download the software packages from the server and install them in the system.
4. Common Yum commands
- List all repositories: yum repolist all
- List all packages in your repository: yum List all
- Check software package information: yum info Software package name
- Installation package: yum install Software package name
- Reinstall the software package: name of the yum software package
- Upgrade package: yum update software package name
- To remove software packages, run the yum remove software package name command
- Yum clean all
- Check updatable software packages: yum check-update
- Check the installed software package group: yum Grouplist on your system
- Install the specified software package group: yum groupinstall Software package group
- To remove a specified package group: yum groupremove package group
- Query information about the specified software package group: yum groupinfo Software package group
However, unregistered RHEL cannot use YUM to install software. Therefore, you need to replace the YUM source with the free source of CentOS to solve the dependency problem.
Replace the yum open source virtual machine (the author of the red hat is installed on the virtual machine) terminal execution RPM - qa | grep the yum yum system will be displayed at the source, The yum component RPM - qa system at delete | grep yum | xargs RPM -e -- nodeps into [netease 163 source image address] (http://mirrors.163.com), Centos /7/ OS/X86_64 /Packages/ download on a physical machine or vm Python-inipars-0.4-9.el7. Noarch, python-inipars-0.4-9.el7. Noarch, yum-3.4.3-161.el7. Yum-metadata-parser-1.1.4-10.el7.x86_64, yum-plugin-fastestmirror-1.1.31-50.el7.noarch RPM -ivh yum-* # RPM >= 0:4.11.3-35 is needed by yum-3.4.3-161.el7.centos.noarch RPM -uvh RPM -4.11.3-35.el7.x86_64. RPM --nodeps RPM -ivh yum-* /etc/ yum-repos. D/vim /etc/yum-repos. D/centos6-base. Repo # # Mirror system uses The connecting IP address of The client and The # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] # name=CentOS-$releasever - Base - 163. com to name = CentOS - 7 - Base - # 163. com baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/ change baseurl=http://mirrors.163.com/centos/7/os/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] # name=CentOS-$releasever - Updates163.com = name= centos-7-updates163.com # baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/ into baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] # $releasever-extras-163.com = $releasever-extras-163.com = $releasever-extras-163.com = $releasever-extras-163.com baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/ into baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing [centosplus] # name= centos-$releasever-plus-163.com # name= centos-7-plus-163.com # baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/ into baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7 #contrib - packages by Centos Users [contrib] # Name = centos-$releasever - contrib-163.com = name= centos-7-contrib-163.com # baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/ into baseurl=http://mirrors.163.com/centos/7/contrib/$basearch/ #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7Copy the code
Yum repolist yum repolist repo id repo name status! Yum repolist yum repolist repo id repo name status! Base /x86_64 CentOS-$7-base-163.com 8,652! extras/x86_64 CentOS-$7 - Extras - 163.com 275 ! Updates /x86_64 CentOS-$7 - updates - 163.com 1,707 repolist: 10,634 How to install and remove pam-devel using yum # install pam-devel [root@xiaohui ~]# yum install pam-devel...... Running Transaction Updating: PAM-1.1.8-22.el7.x86_64 PAM - devel - 1.1.8-22. El7. Two-thirds x86_64 Cleanup: PAM - 1.1.8-9. El7. X86_64 3/3 Verifying: Pam-vel - 1.1.8-22.EL7.x86_64 1/3 Verifying: PAM-1.1.8-22.EL7.x86_64 2/3 Verifying: Pam-1.8-9.el7.x86_64 3/3 Installed: PAM-devel. X86_64 0:1.1.8-22. El7 Dependency Updated: pam-1.8-9.el7.x86_64 3/3 Installed: PAM-devel. PAM. X86_64 1-0. 1.8-22. El7 Complete! The installation is successful. # remove pam-devel [root@xiaohui ~]# yum remove pam-devel...... (omitted) = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Remove 1 Package Installed size: 528 k Is this ok [y/N]: y Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction Erasing : Pam-devel-1.8-22.el7.x86_64 1/1 Loading Mirror speeds from cached hostfile Verifying: Pam-devel-1.8-22.el7.x86_64 1/1 Removed: PAM-devel-1.8-22.el7 Complete! The removal is successful.Copy the code
Attached the article required RPM and repo:pan.baidu.com/s/1lUSU9PdF… Extract code: RP3L
Recommended reading
99% of Linux operation and maintenance engineers must master the command and use
Common commands of the Oracle database in Linux
Common commands of the vi/vim editor in Linux
Install and manage programs in Linux (basic process of package encapsulation, RPM command, source code compilation and installation)
Manage accounts and rights in Linux
Linux disk and file system management
Process and scheduled task management in Linux
Analyze and rectify system faults in Linux
Common KVM commands in Linux
Easily take you to play with the Linux environment under the date syntax!
Exciting 10 command line games that anyone can play with just 2 commands!
17 Funny, but useless, Linux Easter Eggs. It’s the ultimate fun!
In this paper, to the end.
Original is not easy, if you think this article is a little useful to you, please give me a like, comment or forward for this article, because this will be my power to output more quality articles, thanks!
By the way, dig friends remember to give me a free attention yo! In case you get lost and you can’t find me next time.
See you next time!