当前位置:网站首页>Yum is too slow to bear? That's because you didn't do it
Yum is too slow to bear? That's because you didn't do it
2022-07-03 05:47:00 【Tell a joke】
List of articles
Preface
yum It's a Fedora and RedHat as well as SUSE Medium Shell Front end package manager .
be based on rpm Package management , Can be automatically downloaded from the specified server RPM Package and install , Dependency relationships can be handled automatically , And install all the dependent packages at once , No need to download again and again 、 install .
We usually use yum install Command to install the software package of the relevant system online ,yum Installation can automatically handle package related dependencies , And install all the dependent packages at once . as everyone knows , Downloading software from foreign websites is very slow , And there are a lot of things that can't be downloaded . Therefore, some large domestic companies will make relevant synchronization with foreign software , Then we use the domestic download address , You can also download relevant software, and the speed will be much faster than that from foreign websites
One 、 yum Source configuration mode
1、 The system is local yum Source
Usually , stay linux The installation image of the system contains common RPM software package ; Without networking , We can consider using our own local CD as yum Source , Install the relevant required software packages , Local yum The source configuration is as follows :
[[email protected] ~]# mkdir /mnt/dvd // Create the mount point directory of the disc , Later, we will mount our CD image to this directory
[[email protected] ~]# mount /dev/cdrom /mnt/dvd // Mount the disc image to the mount point Directory
[[email protected] ~]# rm -rf /etc/yum.repos.d/* // Delete the yum Source configuration file
Be careful :yum The source configuration file must be in .repo ending
[[email protected] ~]# vi /etc/yum.repo.d/local.repo // To create local yum Source configuration file
[local] // Unique identifier , Be careful : No special characters
name=centos //yum Source description information , You can fill in according to your own situation
baseurl=file:///mnt/dvd //yum Software warehouse mount location , Point to our image mount point directory at that time
enabled=1 // Whether to turn on immediately ,1 For opening ,0 Is not on
gpgcheck=0 // Check signature ,1 For testing ,0 For not testing
[[email protected] ~]# yum clean all // eliminate yum cache
[[email protected] ~]# yum repolist // List available yum Source warehouse rpm Number of bags
2、 The Internet yum Source ( Alibaba cloud yum Source )
Need to connected to the Internet
[[email protected] ~]# rm -rf /etc/yum.repos.d/* // Delete the yum Source configuration file
[[email protected] ~]# cd /etc/yum.repos.d // Get into yum Folder
[[email protected] ~]# wget -o Centos.repo http://mirrors.aliyun.com/repo/Centos-7.repo // Use wget Command to download alicloud repo file
[[email protected] ~]# yum clean all // Clear cache
[[email protected] ~]# yum makecache // Reload cache
[[email protected] ~]# yum repolist // List available yum Source warehouse rpm Number of bags
3、 Customize yum Source
[[email protected] ~]# yum -y install createrepo // install createrepo software package
[[email protected] ~]# mkdir /other_repo/tools // Create custom yum Warehouse folder
[[email protected] ~]# mv *.rpm /other_rpeo/tools // Download all you downloaded from the Internet rpm The software package is centralized into customized yum Warehouse folder
[[email protected] ~]# createrepo /other_repo/tools // Automatically generate warehouse data files according to the software package collection
[[email protected] ~]# vi /etc/yum.repos.d/centos.repo // add to yum The configuration file
[tools] // Unique identification
name=this is my tools // Description information
baseurl=file:///other_repo/tools ////yum The software warehouse points to custom yum Warehouse
enabled=1 // Whether to enable... Now ,1 To enable 0 To not enable
gpgcheck=0 // Whether to detect signature ,1 For testing ,0 For not testing
[[email protected] ~]# yum clean all // eliminate yum cache
[[email protected] ~]# yum repolist // List available yum Source warehouse and rpm Number of bags
Two 、 Self build yum The source server
During the implementation of the project , Many projects have no external network . here , For our convenience , Can be built locally yum The source server , It can make us install software more conveniently and quickly . And our intranet source server can not only be used for building machines , It can also realize the sharing of the whole intranet server
1、 Build the source server
① Mount the required directory and set the boot auto mount
[[email protected] ~]# mkdir -p /var/www/html // establish apache The default path of the web page
[[email protected] ~]# cd /var/www/html // Switch to the default path of the web page
[[email protected] ~]# mkdir centos-1804 other // Create mount directory , Used to mount CDs and package directories
[[email protected] ~]# mount -t iso9660 -o ro,loop /dev/cdrom /var/www/html/centos-1804 // Mount the local CD to /var/www/html/centos-1804
[[email protected] ~]# mkdir /mnt/tools // Create custom yum Warehouse directory
[[email protected] ~]# mv *.rpm /mnt/tools // Download all from the Internet rpm Move the package to the custom warehouse Directory
[[email protected] ~]# mount -t iso9660 -o ro,loop /mnt/tools /var/www/html/other // Mount custom yum Warehouse directory to /var/www/html/other
[[email protected] ~]# vi /etc/rc.d/rc.local // Append the temporarily mounted command to rc.local In file
mount -t iso9660 -o ro,loop /dev/cdrom /var/www/html/centos-1804
mount -t iso9660 -o ro,loop /mnt/tools /var/www/html/other
[[email protected] ~]# chmod +x /etc/rc.d/rc.local // Add executable permissions to files
② Configure local yum Source
[[email protected] ~]# vi /etc/yum.repo.d/local.repo // To create local yum Source configuration file
[local] // Unique identifier , Be careful : No special characters
name=centos //yum Source description information , You can fill in according to your own situation
baseurl=file:///var/www/html/centos-1804 //yum Software warehouse mount location , Point to our image mount point directory at that time
enabled=1 // Whether to turn on immediately ,1 For opening ,0 Is not on
gpgcheck=0 // Check signature ,1 For testing ,0 For not testing
[[email protected] ~]# yum clean all // eliminate yum cache
[[email protected] ~]# yum repolist // List available yum Source warehouse rpm Number of bags
③ install httpd Software package and set the service to start automatically
[[email protected] ~]# yum -y install httpd // install httpd software package
[[email protected] ~]# systemctl start httpd // Turn on httpd service
[[email protected] ~]# systemctl enable httpd // Set up httpd Service starts automatically
2、 client yum Source configuration mode
[[email protected] ~]# rm -rf /etc/yum.repos.d/* // Delete the yum Source configuration file
[[email protected] ~]# vi centos.repo // Creating networks yum Source
[centos-1804]
name=centos-1804
baseurl=http:// The source server ip/centos-1804
enabled=1
gpgcheck=0
[other]
name=other
baseurl=http:// The source server ip/other
enabled=1
gpgcheck=0
[[email protected] ~]# yum clean all // eliminate yum cache
[[email protected] ~]# yum repolist // List available yum Source warehouse rpm Number of bags
3、 ... and 、yum Detailed explanation of related commands
command | notes |
---|---|
yum list | Query all installed and installable packages |
yum search keyword | from yum Find all packages related to keywords on the source server |
yum info Package name | Query the details of the execution package |
yum -y install Package name | Install package . If not -y, Each installed software needs to be answered manually yes,-y It means to answer automatically yes |
yum -y update Package name | Upgrade package ( Need to ensure yum The version of the package in the source is higher than the version of the package installed locally ) |
yum -y remove Package name | Uninstall package ,-y It means that all other software packages that depend on the package will be uninstalled at the same time |
yum groupinfo Software group name | Query the packages contained in the software group |
yum groupinstall Software group name | Install the specified software group |
yum groupremove Software group name | Uninstall the specified software group |
边栏推荐
- [advanced pointer (2)] | [function pointer, function pointer array, callback function] key analysis + code explanation
- Common exceptions when Jenkins is released (continuous update...)
- 今天很多 CTO 都是被干掉的,因为他没有成就业务
- Es 2022 officially released! What are the new features?
- mysql启动报错:The server quit without updating PID file几种解决办法
- 期末复习(Day2)
- How to install and configure altaro VM backup for VMware vSphere
- mapbox尝鲜值之云图动画
- Altaro VM backup getting started
- 2022.DAY592
猜你喜欢
How does win7 solve the problem that telnet is not an internal or external command
kubernetes资源对象介绍及常用命令(五)-(ConfigMap)
一起上水碩系列】Day 9
Together, Shangshui Shuo series] day 9
[advanced pointer (1)] | detailed explanation of character pointer, pointer array, array pointer
[written examination question analysis] | | get [sizeof and strlen] [pointer and array] graphic explanation + code analysis
Exception when introducing redistemplate: noclassdeffounderror: com/fasterxml/jackson/core/jsonprocessingexception
Strategy pattern: encapsulate changes and respond flexibly to changes in requirements
[Zhao Yuqiang] deploy kubernetes cluster with binary package
[explain in depth the creation and destruction of function stack frames] | detailed analysis + graphic analysis
随机推荐
Final review (Day5)
Kubernetes resource object introduction and common commands (V) - (configmap)
[teacher Zhao Yuqiang] redis's slow query log
求质数的方法
Redis使用Lua脚本简介
[advanced pointer (1)] | detailed explanation of character pointer, pointer array, array pointer
Source insight License Activation
Altaro virtual machine replication failed: "unsupported file type vmgs"
Exception when introducing redistemplate: noclassdeffounderror: com/fasterxml/jackson/core/jsonprocessingexception
Download the corresponding version of chromedriver
[function explanation (Part 2)] | [function declaration and definition + function recursion] key analysis + code diagram
Latest version of source insight
[set theory] relational closure (reflexive closure | symmetric closure | transitive closure)
Altaro set grandfather parent child (GFS) archiving
Installation of CAD plug-ins and automatic loading of DLL and ARX
QT read write excel -- qxlsx insert chart 5
Pytorch through load_ state_ Dict load weight
Sophomore dilemma (resumption)
[Zhao Yuqiang] deploy kubernetes cluster with binary package
期末复习DAY8