Add an image source to CentOS
If you want to install gdb on a lab server, you cannot find the source. After adding other sources, you can directly install it.
/Etc/yum. repos. there are some existing sources under the d folder, but many installation packages still cannot be found in these sources, so I added a sohu source according to other online tutorials, and finally succeeded.
Download other faster yum sources
Yum source of HKUST:
Wgethttp: // centos.ustc.edu.cn/CentOS-Base.repo
163 yum Source:
Wgethttp: // mirrors.163.com/.help/CentOS-Base-163.repo
Sohu yum Source
Wgethttp: // mirrors.sohu.com/help/CentOS-Base-sohu.repo
I only successfully added the sohu yum source to these sources, and then updated it to make the operation take effect.
Yum makecache
However, this command still fails to run, and the solution is to comment out the corresponding file in the addons item in the CentOS-Base-sohu.repo, which should be that the source under this option does not exist.
# [Addons]
# Name = CentOS-$ releasever-Addons-163.com
# Items list = http://mirrorlist.centos.org /? Release = & releasever & arch = $ basearch & repo = addons
# Baseurl = http://mirrors.163.com/centos/ Releasever/addons/ Basearch/
# Gpgcheck = 1
# Pgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
Finally, run the command yum makecache to update it. Then you can use yum install gdb to install it.