Category Archives: Linux

How to Solve Conda Error: An HTTP error occurred when trying to retrieve this URL.

Encounter

Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/genomedk/linux-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /genomedk/linux-64/current_repodata.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f4cef822390>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"))

The reason is that an unknown URL has been added to the CONDA source, which can’t be used (or discarded) now

conda config --remove-key channels 
cat ~/.condarc

Problem solving

[Solved] GitHub Warning: Commit failed – exit code 1 received

 

1. Show hidden file: open terminal, execute code

defaults write com.apple.finder AppleShowAllFiles -boolean true;killall Finder

Shortcut key: [shift] + [command] + [.]

2. Delete the [. Git] folder, that is, delete the [. Git] folder contained in the folder

3. Cancel the display of hidden files: open the terminal and execute the code

defaults write com.apple.finder AppleShowAllFiles -boolean false;killall Finder

Shortcut key:[Shift] + [Command] + [.]

Centos7 Compile Error: ./configure: No such file or directory

Generally, look at the readme and install files in the directory, which will tell you how to install the software

Now I know that there may be two situations:

1. When there is no configure in the directory, but there is configure.am or configure.in, you need to use Autoconf command to generate configure. The code is as follows:

$CD (software name) – (version number)
$Autoconf

2. This software or library is not installed in the following way

$CD (software name) – (version number)
$./configure
$make
$sudomakeinstall

You need to carefully read the relevant files under the folder, readme, and so on, according to the way written inside to install

[Solved] Device eth0 does not seem to be present,delaying initialization

First, open/etc/udev/rules.d/70-persistent-net.rules, as shown in the following example:

vim /etc/udev/rules.d/70-persistent-net.rules

Record the mac address 00:15:5d:00:03:01 of the eth1 NIC

Next, open the /etc/sysconfig/network-scripts/ifcfg-eth0

vim /etc/sysconfig/network-scripts/ifcfg-eth0

Change device = eth0 “to device = eth1”,
change hwaddr = 00:15:5d:00:03:01 “to MAC address hwaddr = 00:15:5d:00:04:01”

Finally, restart the network

service network restart

Done!

[How to Solve] Device eth0 does not seem to be present

For the virtual machine clone or template deployment machine, the network card will have the following problems:

service network restart
Shutting down loopback insterface: [ OK ]
Bringing up loopback insterface: [ OK ]
Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization. [FAILED]

Solution:

Open/etc/udev/rules.d/70-persistent-net.rules, check the MAC address of eth1, and then open/etc/sysconfig/network scripts/ifcfg-eth0 after recording

Then, eth0 is replaced by eth1 and the original MAC address is changed

Just restart the network

curl: (7) couldn’t connect to host [How to Solve]

Error when using curl command to visit website:

[root@bqh-119 ~]# curl -I www.test.com
curl: (7) couldn't connect to host
[root@bqh-119 ~]# curl -V #Query version and supported protocols
curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp 
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz 

First, if you can’t Ping the website, go to/etc/hotspot and add the address:

Then check whether the firewall is turned on or whether access rules are added

Curl is normal after closing the firewall. In many cases, it is caused by firewall rules interception, and of course, it is also caused by other configuration reasons

[Solved] Git Couldn’t reserve space for cygwin’s heap

This morning, GIT made a mistake

1. Git pull always makes mistakes: git couldn’t reserve space for cygwin’s heap. The solution to Google is:

C:\Program Files (x86)\Git\bin>rebase.exe -b 0x50000000 msys-1.0.dll

2. Git pull always makes mistakes: git couldn’t reserve space for cygwin’s heap error 0. The solution to Google is:

C:\Program Files (x86)\Git\bin>rebase.exe -b 0x76000000 msys-1.0.dll

Specifically:

1. Run CMD and open it as administrator

2. Run: rebase.exe – B 0x50000000 msys-1.0.dll

When git pull again, no error will be reported

Note:

However, it is said on the Internet that if you first copy msys-1.0.dll in Git/bin to other directory, then copy it to bin directory in CMD as an administrator, and then run rebase.exe – B 0x50000000 msys-1.0.dll again, this error will not be reported: rebaseimage (msys-1.0. DLL) failed with last error = 6

Original address:

http://stackoverflow.com/questions/18502999/git-extensions-win32-error-487-couldnt-reserve-space-for-cygwins-heap-win32

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

 

[root@venn09 ~]# 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

Could not resolve host: solutions to github.com [How to Solve]

There was a problem when submitting the code to github, as shown in the figure:
Code push failed, prompt could not resolve host: github.com
Solution:
1. Open the terminal and enter: ping github.com
2. Modify the /etc/hosts file directly, the same should be done for the windows system, just modify the host file directly, and add at the bottom:
192.30.253.112 github.com
Save the modification and perform the code submission operation again, and it is successful.

 

[Solved] Could not resolve host: mirrorlist.centos.org Centos 7 Unkown error

Questions

After installing centos7 (core), the NIC will not be enabled by default. This is a big pit, and the error is reported directly. this is an over optimization . Several developers/operation and maintenance personnel have installed centos7 (core) without SSH to connect to the server

The error is as follows:

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"
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
Trying other mirror.

 One of the configured repositories failed (CentOS-7 - Base),
 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=base ...

     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 base
        or
            subscription-manager repos --disable=base

     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=base.skip_if_unavailable=true

failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
http://mirror.centos.org/centos/7/os/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirror.centos.org; Unknown error"
[root@localhost ~]#

Solutions

1. After the failure, first, check whether the network is unobstructed

ping www.baidu.com

#google dns
ping 8.8.8.8

There was no response to the above, so I remembered that I had set up a CentOS network card some time ago, and let it start automatically. The order is as follows

vi /etc/sysconfig/network-scripts/ifcfg-ens33

Modify the boot = yes in it

Boot=no (boot up the boot without starting the network card)
#Change to yes

Start network card

ifup ens33

View IP address

ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:63:c2:ca brd ff:ff:ff:ff:ff:ff
    inet 192.168.152.141/24 brd 192.168.152.255 scope global noprefixroute dynamic ens33
       valid_lft 1319sec preferred_lft 1319sec
    inet6 fe80::fdb9:c978:ff44:dbc5/64 scope link noprefixroute
       valid_lft forever preferred_lft forever

The IP address of the virtual machine is 192.168.152.141

2. Update local cache:

yum makecache

[root@promote ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * extras: mirrors.njupt.edu.cn
 * updates: mirrors.cn99.com
base                                                                                                                                     | 3.6 kB  00:00:00
extras                                                                                                                                   | 3.4 kB  00:00:00
updates                                                                                                                                  | 3.4 kB  00:00:00
(1/8): extras/7/x86_64/other_db                                                                                                          | 127 kB  00:00:00
(2/8): extras/7/x86_64/filelists_db                                                                                                      | 246 kB  00:00:00
(3/8): updates/7/x86_64/prestodelta                                                                                                      | 797 kB  00:00:00
(4/8): updates/7/x86_64/other_db                                                                                                         | 641 kB  00:00:00
(5/8): base/7/x86_64/other_db                                                                                                            | 2.6 MB  00:00:01
(6/8): base/7/x86_64/filelists_db                                                                                                        | 7.1 MB  00:00:02
(7/8): updates/7/x86_64/filelists_db                                                                                                     | 4.4 MB  00:00:03
extras/7/x86_64/prestodelta    FAILED
http://mirrors.njupt.edu.cn/centos/7.6.1810/extras/x86_64/repodata/5bfd3d5f07606011226e556e87d978ca1dfe51a63e18d793182900d5bbc702b5-prestodelta.xml.gz: [Errno 14] HTTP Error 302 - Found
Trying other mirror.
(8/8): extras/7/x86_64/prestodelta                                                                                                       |  65 kB  00:00:00
Metadata Cache Created