Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to replace yum Source in Linux system

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Linux system how to replace yum source, in response to this problem, this article details the corresponding analysis and solution, hoping to help more small partners who want to solve this problem find a simpler and easier way.

YUM is an automatic update and package installer/uninstaller for RPM systems. It can automatically calculate dependencies and find out what packages you want to install, so how do you replace yum sources in Linux systems?

Command: #View Package yum list all ##List all available packages in the yum source repository yum list installed ##List all installed packages yum list available ##List installation packages that are not installed #Install software yum install softwarename ##Install specified software yum reinstall softarename ##Reinstall specified software yum localinstall third-party software ##Install third-party files and resolve software dependencies yum remove softwarename ##Uninstall specified software #Find information about software yum info software ##View soft information yum search keywords ##Find information about relevant installation package software according to keywords yum whatprovides filename ##Find related installation packages containing specified files #For software groups yum groups list ##List software groups yum groups install ##Install a software group yum group remove ##Uninstall a software group yum groups info ##View the information of a software group Before you start, check what is in the current configuration. yum source repository yum repolist has been installed.

From the above, you can see that the current yum source configuration has not successfully read the available information. The following will modify the software available to make yum install source.

The first type: use iso image file to make local yum source 1. mount mkdir /mount ##Create an empty folder for mounting iso image files mount /iso/ iso file name /mount ##In order to make iso image files easy to read and use like files, mount iso files in an empty file

(The iso image file mounted here is an existing yum repository, but the system cannot read and identify it. We modify the yum repository pointer file so that the system can read this repository and be used by us)

2. Modify yum source to point to file

mkdir /etc/backup ##Create an empty folder under/etc to backup the original yum source read file mv /etc/yum.repos.d/* /etc/backup/ ##Backup yum repository specify file touch /etc/yum.repos.d/myyum.repo cat > /etc/yum.repos.d/myyum.repo[test] >name=myyumsource >baseurl=file://mount >gpgcheck=0 ## 0 means do not check rpm digital certificate, 1 means check rpm digital certificate>end

3. refresh test

yum clean all ##Empty old data from the local/var/cache/yum container manifest list. yum repolist ##List all available yum repositories, execute this command, reread yum source settings ambition file, refresh local container list. yum repolist ##List all available yum repositories, execute this command, reread yum source settings ambition file, refresh local container list. Now let's look at the yum source repository collection we set up

From above we can see that our mount has been successfully read.

Use the iso-yum local source to install http service to facilitate the creation of shareware sources

yum install httpd

HTTP service installed successfully, now we start the related services.

systemctl start httpd ##Start http service systemctl enable httpd ##Set boot to start http service systemctl stop firewall ##Close firewall service to facilitate the use of the following htpp service The second type: use iso image file to make http shared yum source 1. Unmount/mount ##Unmount files mounted under/mount to be mounted under http service-related directories 2. Remount, mkdir /var/www/html/myshare ##Create a mount point under the http service directory (http services can default to the service directory) mount /iso/iso filename/var/www/html/myshare

refresh service systemctl restart httpd

3. browser testing

Open the browser and enter the ip address of the host to be set, followed by the file to be mounted. When the file appears, it succeeds.

Add repo repository to point to files, so that when looking for yum sources, the system can find yum sources set to http sharing.

touch /etc/yum.repo.d/myshare.repo cat > /etc/yum.repos.d/myshare.repo [share] >name=mysharesource >baseurl=http://172.25.6.10/myshare >gpgcheck=0 >end

yum clean all yum repist error Because our local yum source production and http-yum shared source production use the same iso file, so we unmount the local source iso, execute the yum repist command yum source can not find the contents that we specified in the repository pointing file originally mounted in/mount. Now we can modify the lookup point of the first file so that it finds the/var/www/html/myshare mount point.

yum repolist

The local mount was successfully read without error.

Since this is only a temporary mount, we can also set the boot automount.

cat >> /etc/fstab on Linux system how to replace yum source questions to share the answer here, I hope the above content can be of some help to everyone, if you still have a lot of doubts not solved, you can pay attention to the industry information channel to learn more related knowledge.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report