Category Archives: Linux

bash:yum:command not found [How to Solve]

Today need to use rhel7 to test opencv. When I wanted to install opencv, yum suddenly became unavailable.

prompt:

bash: yum:command not found

I found the following methods on the Internet, and the pro-test is effective (I modified the article a little bit based on my own testing experience).

Steps
The first step:
Download the following RPM package
Python-iniparse-0.4-9.el7.noarch.rpm
yum- metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-3.4.3-161.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm After the
download is complete , Use the rpm command to install, as follows:
rpm -ivh –force –nodeps python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh –force –nodeps yum-metadata-parser-1.1.4- 10.el7.x86_64.rpm
rpm -ivh –force –nodeps yum-3.4.3-161.el7.centos.noarch.rpm
rpm -ivh –force –nodeps yum-plugin-fastestmirror-1.1.31- 40.el7.noarch.rpm
needs to be noted when installing here, be sure to add –force –nodeps, otherwise it will report an error and cannot be installed

At this point, but the following error still appears when I enter the yum command:

Step 2:
Download yum-3.4.3.tar.gz and perform the following steps
wget http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz
tar -zxvf yum-3.4.3 .tar.gz
#Unzip and enter the yum-3.4.3 directory./yummain.py     update

[Solved] Nginx proxy Timeout: upstream timed out (110: Connection timed out)

Environment
Server: centos6.4
Service: nginx proxy

Problem description.

Then look for /opt/usr/nginx/1.4.0/logs error error.log log prompt as follows

2015/01/04 15:44:13 [error] 10112#0: *994662 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 117.32.232.172, server: localhost, request: “POST /community-platform/datastatistics/datastatistics_exportAllUserDataDetail.action HTTP/1.1”, upstream: “http://10.172.11.194:9080/community-platform/datastatistics/datastatistics_exportAllUserDataDetail.action”, host: “admin.zhsqcn.com”, referrer: “http://admin.zhsqcn.com/community-platform/datastatistics/datastatistics_communityStatistics.action?leftPid=98”
2015/01/04 15:45:22 [info] 10112#0: *994692 client closed connection while waiting for request, client: 117.32.232.172, server: 0.0.0.0:80

2015/01/04 15:57:10 [info] 10112#0: *994707 client 1.85.57.66 closed keepalive connection
2015/01/04 15:57:19 [info] 10112#0: *994711 client 1.85.57.66 closed keepalive connection
2015/01/04 15:57:19 [info] 10112#0: *994718 client closed connection while waiting for request, client: 1.85.57.66, server: 0.0.0.0:80

Solution: vi /opt/usr/nginx/1.4.0/conf/nginx.conf
The reason is that the nginx proxy timeout is too short
proxy_connect_timeout 3;
proxy_read_timeout 30;
proxy_send_timeout 30;

Change to

proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_send_timeout 600;

Then just restart nginx:

/opt/usr/nginx/1.4.0/sbin/nginx -s reload

CentOS7 Failed to start LSB: Bring up/down [How to Solve]

Just installed the virtual machine suddenly can not access the Internet, the error reported very strange, the specific error reported as follows.

/etc/init.d/network restart

Restarting network (via systemctl): Job for network.service failed because the control process exited with error code. See “systemctl status network.service” and “journalctl -xe” for details.

[Failed]

Use the systemctl status network.service command to view the results as follows.

network.service – LSB: Bring up/down networking

Loaded: loaded (/etc/rc.d/init.d/network)

Active:failed(Result: exit-code) since 三 2016-08-17 11:34:36 CST; 54s ago

Docs: man:systemd-sysv-generator(8)

Process: 3847 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Aug 17 11:34:36 python.cn network[3847]: RTNETLINK answers: File exists

Aug 17 11:34:36 python.cn network[3847]: RTNETLINK answers: File exists

Aug 17 11:34:36 python.cn network[3847]: RTNETLINK answers: File exists

Aug 17 11:34:36 python.cn network[3847]: RTNETLINK answers: File exists

Aug 17 11:34:36 python.cn network[3847]: RTNETLINK answers: File exists

Aug 17 11:34:36 python.cn network[3847]: RTNETLINK answers: File exists

Aug 17 11:34:36 python.cn systemd[1]: network.service: control process exited, code=exited status=1

Aug 17 11:34:36 python.cn systemd[1]:Failed to start LSB: Bring up/down networking.

Aug 17 11:34:36 python.cn systemd[1]: Unit network.service entered failed state.

Aug 17 11:34:36 python.cn systemd[1]: network.service failed.

Checking the system log, the following errors are reported.

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python network: RTNETLINK answers: File exists

Aug 17 11:34:36 python systemd: network.service: control process exited, code=exited status=1

Aug 17 11:34:36 python systemd:Failed to start LSB: Bring up/down networking.

Aug 17 11:34:36 python systemd: Unit network.service entered failed state.

Aug 17 11:34:36 python systemd: network.service failed.

Aug 17 11:36:28 python systemd: Starting LSB: Bring up/down networking…

Aug 17 11:36:29 python network:

Opening loopback interface: Unable to load file ‘/etc/sysconfig/network-scripts/ifcfg-lo’

Aug 17 11:36:29 python network: could not load file ‘/etc/sysconfig/network-scripts/ifcfg-lo’

Aug 17 11:36:29 python network: could not load file ‘/etc/sysconfig/network-scripts/ifcfg-lo’

Aug 17 11:36:29 python network: could not load file ‘/etc/sysconfig/network-scripts/ifcfg-lo’

Aug 17 11:36:29 python network: [ OK ]

Aug 17 11:36:29 python network: opening interface eno16777736: error: failed to activate connection: No suitable device found for this connection.

After checking, I confirmed that the /etc/sysconfig/network-scripts/ifcfg-lo file exists. Where does the problem occur?

 

Solution:

With the system comes with NetworkManager this management suite has a relationship, turn off can be solved.

Try.

systemctl stop NetworkManager

systemctl disable NetworkManager

Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.

Removed symlink /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service.

Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.

Restarting the network.

systemctl start network.service

ifconfig |grep eno

eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500

inet 192.168.1.192 netmask 255.255.255.0 broadcast 192.168.1.255

inet6 fe80::20c:29ff:fe3d:b305 prefixlen 64 scopeid 0x20<link>

ether 00:0c:29:3d:b3:05 txqueuelen 1000 (Ethernet)

RX packets 2 bytes 120 (120.0 B)

RX errors 0 dropped 0 overruns 0 frame 0

TX packets 22 bytes 3551 (3.4 KiB)

TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

The network starts normally and access is normal.

[Solved] Go get fatal: could not read Username for ‘https://code.xxx.org’: terminal prompts disabled

When downloading the private codebase with go get, the following error was somehow generated, while the public codebase was not affected.

chenchideMacBook-Pro:~ chenchi$ go get code.xxx.org/adarch/kitedemo

# cd .; git clone https://code.xxx.org/adarch/kitedemo.git /Users/chenchi/go/src/code.xxx.org/adarch/kitedemo

Cloning into ‘/Users/chenchi/go/src/code.xxx.org/adarch/kitedemo’…

fatal: could not read Username for ‘https://code.xxx.org’: terminal prompts disabled

package code.xxx.org/adarch/kitedemo: exit status 128

 

 

Solution:

Enter the following command.

env GIT_TERMINAL_PROMPT=1 go get code.xxx.org/adarch/kitedemo

You will be prompted to enter your username and password, and then it works perfectly.

chenchideMacBook-Pro:~ chenchi$ env GIT_TERMINAL_PROMPT=1 go get code.xxx.org/adarch/kitedemo

Username for ‘https://code.xxx.org’: chenchi.szt

Password for ‘https://[email protected]’:

Of course, you can also git clone directly.

[Solved] Linux Start database Error: could not open parameter file init**.ora

Sqlplus/nolog, Conn/as SYSDBA, startup command

SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ‘/home/oracle/app/product/11.2.0/dbhome_ 1/dbs/initLCDC.ora’

Look up the file, it doesn’t exist. It is estimated that it is caused by illegal shutdown

This is because in Oracle 9i and Oracle 10g, Oracle will use SPFILE to start the database by default. If SPFILE does not exist, the above error will appear

Solution 1:
add $Oracle_Copy the init.ora.012009233838 file in the base/admin/database name/pfile directory to $oracle_Initlcdc.ora in the home/DBS directory( Note: Oracle in initoracle.ora is your instance name oracle_ Sid, the file name is the file name of the error prompt)

The corresponding path is:

Path 1: Home/Oracle/APP/admin/LCDC/pfile/init.ora.4132019135738

Path 2: Home/Oracle/APP/product/11.2.0/dbhome_ 1/dbs

Centos7 Install MYSQL Error: Could NOT find Curses (missing CURSES_LIBRARY CURSES_INCLUDE_PATH)

Today, when installing mysql 5.7, I had the following problem when compiling.

[root@localhost software]# cd mysql-5.7.21

[root@localhost mysql-5.7.21]# cmake .

The following error message appears.

— Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:250 (MYSQL_CHECK_READLINE)

— Configuring incomplete, errors occurred!

 

Solution:

[root@xxxxxxx mysql-5.7.21]# rm CMakeCache.txt

[root@xxxxxxx mysql-5.7.21]# yum install ncurses-devel

[root@xxxxxxx mysql-5.7.21]# yum install bison

[[email protected]]# make && make install

Done!

[Solved] SVN Error: “containing working copy admin area is missin

I. Introduction
Scene description
A directory was created in SVN, but it was not deleted in svn, but was deleted directly in the resource manager or finder. At this time, SVN will report an error saying that the created directory cannot be found. The error message is: “containing working copy admin area is missing”

Such as

Directory’XX/.svn’ containing working copy admin area is missing

So how to deal with it

Two, the solution
1. Delete the XX directory.

2, Use the SVN Update command to update XX and its sub-directory resources, specific to the eclipse project, right-click on the parent directory of the deleted directory and select Team-》Update

Get it done.

[How to Solve] gcc-4.7.2 cannot compute suffix of object fil…

I intend to learn C++ 11, so I have to change the compiler. After downloading the latest source code, I compile it according to the usual process: 1.

1. Unpack the RPM package:

[root@linuxopt]# tar xjvf gcc-4.0.1.tar.bz2 (unpacked to generate the source directory /opt/gcc-4.0.1)

2. Create the installation target directory:

[root@linux opt]# mkdir /usr/local/gcc-4.0.1/

3. Enter the installation target directory: [root@linux opt]# mkdir /usr/local/gcc-4.0.1/

[root@linux opt]# cd /usr/local/gcc-4.0.1/ (this step is important, when configuring the installation files, you need to execute the configure command in the target directory)

[root@linux opt]# pwd

/usr/local/gcc-4.0.1

4. Configure the installation files.

[root@linux gcc-4.0.1]# % ../gcc-4.1.2/configure –prefix=/usr/local/gcc-4.1.2 –enable-threads=posix –disable-checking –enable–long-long –host=i386-redhat-linux–with-system-zlib –enable-languages=c,c++,java

creating cache ./config.cache

checking host system type… i686-pc-linux-gnu

5. Compile the installation files:

[root@linux gcc-4.0.1]# pwd

/usr/local/gcc-4.0.1

[root@linux gcc-4.0.1]# make (execute compilation in the target directory)

6. Install gcc:</strong

[root@linux gcc-4.0.1]# pwd

/usr/local/gcc-4.0.1

[root@linux gcc-4.0.1]# make install (execute install in the target directory)

 

The above is the installation process of others, I installed the latest Gcc-4.7.2, the steps are almost the same, is the following problem.

But when make, unfortunately, there is a

“checking for suffix of object files… configure: error: cannot compute suffix of object files: cannot compile

See `config.log’ for more details.

make[2]: *** [configure-stage1-target-libgcc] Error 1

make[2]: Leaving directory `/tmp/gcc-4.3.2′

make[1]: *** [stage1-bubble] Error 2

make[1]: Leaving directory `/tmp/gcc-4.3.2′

make: *** [bootstrap] Error 2

Follow the prompts to open the config.log

Find the cause of the error.“when loading shared libraries:libmpc.so.3:cannot open shared object file: No such file or directory”.

So that’s it. Next, add the mpc, gmp, and mpfr lib folders to the LD_LIBRARY_PATH variable decisively.

Note that the three libs here are set according to the path you installed.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/mpc-1.0/lib:/usr/local/gmp-5.0.5/lib:/usr/local/mpfr-3.1.1/lib

 

Next, reconfigure

make

and wait for a long time

…………

 

Done!

 

[Solved] Linux Error: configure: error: C compiler cannot create executables

Prompt when compiling and configuring source code:

[wlf@wlf185 otp_src_21.3]$ ./configure --prefix=/home/wlf/erlang
Ignoring the --cache-file argument since it can cause the system to be erroneously configured
Disabling caching
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/wlf/otp_src_21.3':
configure: error: C compiler cannot create executables
See `config.log' for more details

See config.log:

configure:2576: $?= 0
configure:2565: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
configure:2576: $?= 0
configure:2565: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2576: $?= 4
configure:2565: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:2576: $?= 4
configure:2596: checking whether the C compiler works
configure:2618: gcc    conftest.c  >&5
collect2: fatal error: cannot find 'ld'
compilation terminated.
configure:2622: $?= 1
configure:2660: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2665: error: in `/home/wlf/otp_src_21.3':
configure:2667: error: C compiler cannot create executables
See `config.log' for more details

If LD can’t be found, let’s confirm:

[wlf@wlf185 otp_src_21.3]$ which ld
/usr/bin/which: no ld in (/usr/local/mongodb/bin:/opt/jdk/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/wlf/.local/bin:/home/wlf/bin)

There is no LD, isn’t it? Then switch to root and install it

[root@wlf185 bin]# yum install binutils
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package binutils-2.25.1-22.base.el7.x86_64 already installed and latest version
Nothing to do
[root@wlf185 bin]# ld -v
-bash: ld: command not found

Seeing the ghost, I’m pretending, but I can’t use it. Come back

[root@wlf185 bin]# yum reinstall binutils
Loaded plugins: product-id, search-disabled-repos, 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 binutils.x86_64 0:2.25.1-22.base.el7 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
 Package                                Arch                                 Version                                            Repository                         Size
========================================================================================================================================================================
Reinstalling:
 binutils                               x86_64                               2.25.1-22.base.el7                                 DVD                               5.4 M

Transaction Summary
========================================================================================================================================================================
Reinstall  1 Package

Total download size: 5.4 M
Installed size: 22 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : binutils-2.25.1-22.base.el7.x86_64                                                                                                                   1/1 
failed to read link /usr/bin/ld: No such file or directory
  Verifying  : binutils-2.25.1-22.base.el7.x86_64                                                                                                                   1/1 

Installed:
  binutils.x86_64 0:2.25.1-22.base.el7                                                                                                                                  

Complete!
[root@wlf185 bin]# ld -v
GNU ld version 2.25.1-22.base.el7

OK, switch back to WLF user and recompile the configuration

[Solved] CondaHTTPError: HTTP 000 CONNECTION FAILED for url

conda error:  CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://nanomirrors.tuna.tsinghua.edu.cn/anaconda/cloud/linux-64/rpodata.json> Elapsed: –

 

1. delete part of the channels configuration file

However, there is still a problem, cat ~/.condarc.bak and the url seems fine

2. vim ~/.condarc

Found an extra line ssl_verify: true

Oh, so I need the ssl certificate. Just change the https to http

3. Then test it conda install lxml

Collecting package metadata (current_repodata.json): done

Solving environment: done ## Package Plan ##

Done!