Tag Archives: Yum

Workaround for “could not retrieve mirrorlist” during Yum installation

[ [email protected] ~]# yum -y install wget    ( Note: after downloading the WGet command and installing it)

Could not retrieve mirrorlist   http://mirrorlist.centos.org/?release=5&amp ; arch=i386& repo=os   error was
[Errno 4] IOError: < urlopen error (-3, ‘\xe5\x9f\x9f\xe5\x90\x8d\xe8\xa7\xa3\xe6\x9e\x90\xe6\x9a\x82\xe6\x97\xb6\xe5\xa4\xb1\xe8\xb4\xa5’)>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

[ [email protected] ~]# yum install gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist   http://mirrorlist.centos.org/?release=5&amp ; arch=x86_ 64& repo=addons   error was
[Errno 4] IOError: < urlopen error (-3, ‘Temporary failure in name resolution’)>
Error: Cannot find a valid baseurl for repo: addons

 

Whether you use the command above or below, the error will appear

Reason: resolv.conf is not configured

resolvent:

Configure resolv.conf in the/etc directory to join the nameserver IP, such as:

nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain

Save and run the above command again.

 

=================================

/Configure DNS clients in/etc/resolv.conf  

 

/Etc/resolv.conf configure DNS client
file/etc/resolv.conf configure DNS client, which contains the domain name search order of the host and the address of the DNS server. Each line should contain a keyword and one or more parameters separated by spaces
here is an example file:

nameserver 8.8.8.8
nameserver 8.8.4.4
search localdomain

The legal parameters and their meanings are as follows:
nameserver indicates the IP address of the DNS server. There can be many rows of nameservers, each with an IP address. When querying, follow the order of nameservers in this file, and only when the first nameserver does not respond, query the following nameserver.
domain declares the domain name of the host. Many programs use it, such as mail system; It is also used when DNS query is performed for the master
machine without domain name. If there is no domain name, the host name will be used and all content before the first dot (.) will be deleted
search its multiple parameters indicate the order of domain name query. When you want to query a host without a domain name, the host will search separately in the domain declared by search. Domain and search cannot coexist; If both exist, the following will be used
sortlist allows you to sort the domain name results. Its parameters are network/mask pairs. Allow any sort order. The default/E T C/r e s o l v. c o n f file is not available in red hat. Its contents are dynamically created according to the options given at installation time.

How to Solve Yum Install Development Tools Error

An error occurred while installing development tools using yum

When we install the development tools development group tools through yum, we may sometimes encounter the following error messages

[[email protected] ~]# yum groupinstall "Development Tools"
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Determining fastest mirrors
^[[A^[[A
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                    | 3.6 kB     00:00     
epel                                                    | 5.3 kB     00:00     
extras                                                  | 3.4 kB     00:00     
updates                                                 | 3.4 kB     00:00     
(1/7): base/7/x86_64/group_gz                             | 166 kB   00:00     
(2/7): epel/x86_64/updateinfo                             | 994 kB   00:01     
(3/7): extras/7/x86_64/primary_db                         | 205 kB   00:01     
(4/7): epel/x86_64/group_gz                               |  88 kB   00:05     
(5/7): epel/x86_64/primary_db                             | 6.8 MB   00:17     
(6/7): base/7/x86_64/primary_db                           | 6.0 MB   00:19     
(7/7): updates/7/x86_64/primary_db                        | 6.5 MB   00:19     
Warning: Group development does not have any packages to install.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

There are two solutions to this problem

 

Method 1

yum clean all
yum groupinstall "Development Tools"

Method 2

If the above method is useless, execute the following command

cd /etc/yum.repos.d
sudo wget http://public-yum.oracle.com/public-yum-el5.repo
cd /etc/pki/rpm-gpg/
sudo wget https://public-yum.oracle.com/RPM-GPG-KEY-oracle-el5

After execution, install

yum groupinstall "Development Tools"

The above methods are useful for personal testing. I hope they can help you

[Solved] Yum command error: could not retrieve mirrorlist http://mirrorlist.centos.org…

Yum command error reporting solution

Problem Description:

An error occurs when running the yum install gcc-c + + command on the VMware virtual machine

Error message:

could not retrieve mirrorlist http://mirrorlist.centos.org/release=6&arch=x86_64%repo=os error was 14: PYCURL ERROR 
6 - "Counldn't resolve host 'mirrorlist.centos.org'"

Possible cause analysis:

1. DNS is not set

2. The connection mode of the network adapter is incorrect. The NAT mode is used locally and the bridge mode is used for the router

3. IP is not in the same network segment

4. The virtual machine service is not turned on

Solution:

1. Open the virtual machine — > Virtual machine settings — > Network adapter — > Network connection, set to bridge mode

2. Open ifcfg eno16777736 under etc/sysconfig/network scripts (the file name may be different), and set:

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eno16777736
UUID=4875d5bc-07e0-4951-8cd3-3fa7570c6201
ONBOOT=yes
HWADDR=00:0C:29:12:7C:E7
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes

 

3. Open the resolv.conf file in the directory etc and set:

3.1 if the network cable is directly connected to the local route, make the following settings:

domain www.tendawifi.com            [loacal DNS]
search www.tendawifi.com            [loacal DNS]
nameserver 192.168.0.1                [loacal IP]

3.2 if WiFi is connected, set:

# this is google DNS
nameserver 8.8.8.8
nameserver 8.8.4.4

# localhost DNS
nameserver 168.192.1.1            [local default gateway]
nameserver 168.192.1.101 [local IPv4 address]
search localdomain [fixed, means search local DNS]

4. Restart the service, service network restart, Ping Google Ping www.google.com

Error reporting using Yum: Yum except keyboardinterrupt, e

An error was reported when using Yum today:

[[email protected] /]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax

It turned out that I installed Python 3.5 a few days ago

According to the prompt, the solution:

[[email protected] /]# vim /usr/bin/yum #!/usr/bin/python import sys try: import yum except ImportError: print >> sys.stderr, """\

Change the above statement to the default version of python2.6 before the system:

#!/usr/bin/python2.6 import sys try: import yum except ImportError: print >> sys.stderr, """\

yum can be used

:

Python upgrade resulted in an error using yum

Today, we plan to install walle 2.0 according to the official documents http://www.walle-web.io/docs/index.html Step by step

At this step, an error is suddenly reported

yum install -y mariadb-devel gcc gcc-c++ python-devel

 

At first, I wondered if there was a problem with the yum source. Download and load the alicloud source again

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo 
yum clean all  
yum makecache

If you can’t find it, you still report an error

check the python version

# python
Python 2.7.5 (default, Oct 30 2018, 23:45:53) 

It is found that Python has been upgraded to 2.7.5, and the python version required by Yum is 2.6, resulting in an error

modify the yum startup file prefix

# cat /usr/bin/yum
#!/usr/bin/python2.7

It is found that it is useless and there is no backup. Python is directly updated to 2.7.5. The library used by Yum cannot be loaded and the module cannot be loaded

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

 

Find the information, try to install another version of python2.6.6, and modify the yum startup file, but the module cannot be loaded

reinstall Python and Yum

1. Uninstall existing Python and force the removal of installed programs and their associations

rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps

Force deletion of all residual files

whereis python |xargs rm -frv

2. Uninstall existing yum

rpm -qa|grep yum|xargs rpm -ev --allmatches --nodeps

Force deletion of all residual files

whereis yum |xargs rm -frv

3. Download the RPM package corresponding to the version

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-build-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-sign-4.11.3-35.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/rpm-python-4.11.3-35.el7.x86_64.rpm

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-2.7.5-76.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-devel-2.7.5-76.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-libs-2.7.5-76.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-9.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-backports-1.0-8.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-backports-ssl_match_hostname-3.5.0.1-1.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-chardet-2.2.1-1.el7_1.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-ipaddress-1.0.16-2.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/python-virtualenv-15.1.0-2.el7.noarch.rpm

wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-3.4.3-161.el7.centos.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-utils-1.1.31-50.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-50.el7.noarch.rpm
wget http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/yum-plugin-aliases-1.1.31-50.el7.noarch.rpm

Install these packages after downloading (- – force forced installation)

rpm -Uvh --force --nodeps --replacepkgs *.rpm

After installing these RPM packages, yum can be used normally. If you still report the following, it means that you haven’t downloaded all the RPM packages

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /usr/lib64/python2.7/site-packages/rpm/_rpm.so: undefined symbol: rpmpkgVerifySi

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Apr 11 2018, 07:36:10)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

 

Then press the walle official document to install step by step, and the installation is completed successfully ~:)

say important things three times

Python upgrade is upgraded with the downloaded package. Back up the old version before upgrading

Python upgrade is upgraded with the downloaded package. Back up the old version before upgrading

Python upgrade is upgraded with the downloaded package. Back up the old version before upgrading

 

Install the software Yum to process the error segmentation fault [Solved]

yum installation software error Segmentation fault handling

 

When using yum to update software, it prompts.
Segmentation fault

Chinese error message: Segmentation fault

[[email protected]:/usr/local/lib]# yum install -y screen
Freeing read locks for locker 0x2f: 13195/140686785021696
Freeing read locks for locker 0x31: 13195/140686785021696
Freeing read locks for locker 0x32: 13195/140686785021696
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://apt.sw.be/redhat/el6/en/mirrors-rpmforge error was
14: PYCURL ERROR 6 – “Couldn’t resolve host ‘apt.sw.be'”
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Segmentation fault

It is possible that zlib was manually compiled and installed, and /etc/ld.so.conf was modified to include /usr/local/lab

The system has two versions of zlib, use ldconfig -v|grep libz to see the two versions of zlib.

 

[[email protected]:/usr/local/lib]# ldconfig -v|grep libz
ldconfig: Can’t stat /usr/local/lab/libevent-2.0.21-stable/lib: No such file or directory
libz.so.1 -> libz.so.1.2.5
libz.so.1 -> libz.so.1.2.3
[[email protected]:/usr/local/lib]# find/-name ‘libz.so.1’
/lib64/libz.so.1
/usr/local/lib/libz.so.1
/usr/local_bak/lib/libz.so.1
/usr/local_source/zlib-1.2.5/lib/libz.so.1

So, comment out the zlib in /etc/ld.so.conf.
[[email protected]:/data/mysql_data]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
#####ADD BY lx#####
/usr/local/BerkeleyDB-4.8.30/lib
/usr/local/lab/ltp-full-20140115/lib
/usr/local/mysql/lib
/usr/local/lab/openssl/lib
/usr/local/lab/libevent-2.0.21-stable/lib
/usr/local/so
/usr/local/lab
#/usr/local/lib

Execute ldconfig once

Execute yum clean all

yum install screen -y

Done!

Yum installer reported an error: nothing to do [How to Solve]

Today, install some common software on a new server. At the beginning, install NCDU (a very useful disk analysis tool to find large files). The errors are as follows:

I found various methods on the Internet. It’s useless to update Yum and clean up Yum cache

The last problem found is the lack of EPEL (EPEL is a free and open source software package version library strongly built by the community, and the system contains about 10000 software packages). I am centos7, so I need to install this first

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Other versions can be installed on the official website https://fedoraproject.org/wiki/EPEL

After that, NCDU will be installed normally

yum -y install ncdu

yum :Another app is currently holding the yum lock; waiting for it to exit……

How did “people you might know” find you on social software>>>

During the development process, you need to use the yum command. Sometimes you will report the following error when executing yum

Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  48 M RSS (443 MB VSZ)
    Started: Thu Mar 26 09:47:03 2020 - 00:23 ago
    State  : Running, pid: *****

Cause analysis: Yum can only support one routine. If one routine is already running, others must wait for the process to exit and release the lock. In this case,
can be restored with the following command:

rm -f /var/run/yum.pid

Record –

[Solved] Yum Install Error: Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&am…

 

[[email protected] ~]# yum install -y vim
Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/x86_64

DNS server not found

Solution:

Configure /etc/resolv. Conf

Add the following:

nameserver 8.8.8.8  #google Provided dns servers
nameserver 8.8.4.4  #google Provided dns servers

Repeat. It’s done