Category Archives: Linux

[Solved] FATAL CONFIG FILE ERROR: Bad directive or wrong number of arguments

Error message

Error reporting reason

The reason is that it is not allowed to add comments after the same valid code line in some configuration files (such as. Conf files, which are widely seen here), which will compile and execute the following comments as the parameters passed in from the current command line; If there are no parameters in the command configuration or the format of the parameters is wrong, an error will be reported naturally
for example:

Solution

Divide the original configuration into two lines of commands and comments

[Solved] ERROR: The kernel module failed to load, because it was not signed by a key that is trusted by the

ubuntu encountered the following problem installing the graphics card driver
ERROR: The kernel module failed to load, because it was not signed by a key that is trusted by the kernel. Please try installing the driver again.
and sign the kernel when prompted to do so.
ERROR:  Unable to load the kernel module ‘nvidia.ko’. This happens most
frequently when this kernel module was built against the wrong or
improperly configured kernel sources, with a version of gcc that
differs from the one used to build the target kernel(1), or if a driver
such as rivafb, nvidiafb. or nouveau is present and prevents the
NVIDIA kernel module from obtaining ownership of the NVIDIA
graphics device(s), or no NVIDIA GPU installed in this system is
supported by this NVIDIA Linux graphics driver release.

 

Solution:
Enter BIOS to turn off Secure Boot

How to Solve Oracle startup monitoring error

Solve the error of Oracle startup monitoring

On the Linux virtual machine, start the Oracle listening service:

[oracle@localhost ~]$ lsnrctl start

As a result, a listening error message appears, as follows:

TNS-12537: TNS:connection closed
 TNS-12560: TNS:protocol adapter error
  TNS-00507: Connection closed
   Linux Error: 29: Illegal seek

After many attempts and data access, it is found that the error is caused by the default hostname. At this time, the following steps can be taken to solve the above error reporting problem:

    1. modify hostname
[root@localhost oracle]# hostname oracle

Add “host IP oracle” in the/etc/hosts file

[root@oracle oracle]# vim /etc/hosts
...
localhost ip oracle

Add “hostname = oracle” in the etc/sysconfig/network file

[root@oracle oracle]# vim /etc/sysconfig/network
...
hostname=oracle

Restart listening

[root@oracle oracle]# lsnrctl start

After a wave of configuration, monitoring is successfully enabled:

[Solved] Ubuntu Update source error: Certificate verification failed: The certificate is NOT trusted.

Updating the Ubuntu source today always reports an error

Ign:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease
Ign:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease
Ign:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease
Ign:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease
Err:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Err:6 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Err:7 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Err:8 https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security Release
  Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate.  Could not handshake: Error in the certificate verification. [IP: 101.6.15.130 443]
Reading package lists... Done
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Finally, refer to the method of online leaders, change HTTPS in the software source to HTTP, and solve it successfully.

# The source image is commented by default to improve the speed of apt update, you can uncomment it if needed
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists

The error information is as follows:

reason

In the process of writing, unexpected power failure, link failure, SSH client abnormal shutdown, etc. the server backed up the write operation, but did not write to the real file.

Editing a file with VIM is actually copying a temporary file and mapping it to memory for you to edit,   Editing is a temporary file,   Save the temporary file to the original file only after executing: W, and delete the temporary file only after executing: Q.

Each time you start editing, you will retrieve whether this file already exists as a temporary file,   If someone asks how to deal with it, the above situation will appear.

Workaround – delete temporary files

Select the temporary file path and right-click copy.

Enter Q again to exit

Delete temporary files. Execute the following command:

rm -rf /etc/nginx/.nginx.conf.swp

[Solved] Error: no “print“ mailcap rules found for type “text/plain“

Blog background

The author has always wanted to understand how to use the Print command under Linux?

Direct Print hello. TXT will report an error

Error: no "print" mailcap rules found for type "text/plain"

Specific operation

ubuntu@139:~/temp $ cat /etc/mailcap | egrep print
application/x-troff-man; /usr/bin/nroff -mandoc -Tutf8; copiousoutput; print=/usr/bin/nroff -mandoc -Tutf8 | print text/plain:-
text/troff; /usr/bin/nroff -mandoc -Tutf8; copiousoutput; print=/usr/bin/nroff -mandoc -Tutf8 | print text/plain:-
text/plain; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; print=cat %s; needsterminal
application/x-tar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-gtar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-ustar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
ubuntu@139:~/temp $ ls
hello  hi.txt
ubuntu@139:~/temp $ cat hi.txt 
hello
ubuntu@139:~/temp $ print hi.txt 
hello

This is the situation after I edit the mailcap file. Pay attention to this line

text/plain; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; print=cat %s; needsterminal

That is, just add a print command rule after text/plain, which is so simple.

Aliyunshield occupies port 80 error: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use

Error starting userland proxy: listen TCP 0.0.0.0:80: bind: address already in use
today, it was found that port 80 was occupied on Ali’s server. The advantages are inexplicable. An investigation found that the process aliyundun occupied the port

tcp          100.100.100.200:80      TIME_WAIT   -                   
tcp          100.100.30.25:80        ESTABLISHED 1472/AliYunDun      
tcp          100.100.100.200:80      TIME_WAIT   -          

Displaying with kill is not allowed

[root@lingg ~]# kill 1472
-bash: kill: (1472) - Disallowed operations
[root@lingg ~]# kill -9 1472
-bash: kill: (1472) - Disallowed operations

Then I found the solution online as follows

sudo fuser -k 80/tcp

```bash
[root@lingg ~]# sudo fuser -k 80/tcp
80/tcp:               1267  1272  1273  1274

Done!

How to Solve Ubuntu20.04 Compile Error:error while loading shared libraries: libncurses.so.5

Project scenario:

Ubuntu 20.04 compilation error: error while loading shared libraries: libncurses. So. 5: cannot open shared object file: no such file or directory


Cause analysis:

libncurses5 file is missing 


Solution:

install libncurses5 to solve the problem. The commands are as follows

$      sudo apt install libncurses5