In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to configure yum locally in redhat. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.
Because yum cannot be used without registration after redhat is installed, the local configuration of yum repository is adopted.
System: Red Hat Enterprise Linux Server release 7. 0 (Maipo)
1. Create a directory
[root@happy ~] # mkdir / mvp
[root@happy ~] # cd / mvp/
[root@happy mvp] # mkdir-p / mnt/cdrom
(check in / mnt/cdrom after installation)
Copy iso to / mvp
[root@happy mvp] # ls
RHEL-server-7.0-x86_64-LinuxProbe.Com.iso
2. Add configuration (add at the end)
[root@happy mvp] # vim / etc/fstab
/ mvp/RHEL-server-7.0-x86_64-LinuxProbe.Com.iso / mnt/cdrom iso9660 defaults,ro 0 0
3. Mounting
[root@happy mvp] # mount-a
4. Configuration
[root@happy cdrom] # vim / etc/yum.repos.d/rhel.repo
[mvpbang]
Name=mvpbang
Gpgcheck=0
Enabled=1
Baseurl= file:///mnt/cdrom
~
5. Run
[root@happy cdrom] # yum repolist
[root@happy cdrom] # yum clean all
[root@happy cdrom] # yum makecache
Iso can be deleted after successful installation.
The second method
Need to have an iso image to install linux and be connected to the linux
1. Change directories and edit configuration files
[root@happy ~] # cd / etc/yum.repos.d/
[root@happy yum.repos.d] # vim rhel7.repo
[rhel7]
Name=rhel7
Baseurl= file:///media/cdrom
Enabled=1
Gpgcheck=0
2. Create the path where the CD is mounted
[root@happy yum.repos.d] # mkdir-p / media/cdrom
3. Mounting
[root@happy yum.repos.d] # mount / dev/cdrom / media/cdrom/
Mount: no medium found on / dev/sr0
(error reason: the installed iso image was not found)
Directly select the hardware of linux to the iso image on vm, and connect
Solution: connect iso to linux
[root@happy yum.repos.d] # mount / dev/cdrom / media/cdrom/
Mount: / dev/sr0 is write-protected, mounting read-only
4. Write the mount information well, and mount it automatically every time you boot.
[root@happy yum.repos.d] # vim / etc/fstab
/ dev/cdrom / media/cdrom iso9660 defaults 0 0
5. Success
[root@happy yum.repos.d] # yum install httpd
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
-> Running transaction check
-> Package httpd.x86_64 0RU 2.4.6-17.el7 will be installed
-- > Processing Dependency: httpd-tools = 2.4.6-17.el7 for package: httpd-2.4.6-17.el7.x86_64
.
Successfully configure yum
To sum up: both methods can be used to configure the yum repository. The first one requires copying the iso into the linux without the need to connect to the iso of the host.
It is also possible; second, directly operate the iso image on the host, saving linux memory.
This is how redhat configures yum locally. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.