Home Operation and Maintenance Linux Operation and Maintenance What are the common errors in Linux?

What are the common errors in Linux?

Jun 06, 2020 pm 04:20 PM
linux

What are the common errors in Linux?

Solutions to common Linux errors:

In daily development, especially when operating in Linux, we often encounter to various errors. Record it, practice makes perfect, slowly understand the mysteries of Linux

1) When installing the SSL certificate, the certbot command cannot be used

What are the common errors in Linux?

Solution :

Use yum to reinstall and uninstall the software installed using pip

pip uninstall requests
yum reinstall python-requests
 
pip uninstall six
yum reinstall python-six
 
pip uninstall urllib3
yum reinstall python-urllib3
Copy after login

 2) Problem. xxx is not in the sudoers file. This incident will be reported.(When thinking When you want to switch to root permissions as xxx, use the sudo su command and enter the password of *** as prompted (the error message that appears)

Solution

1.修改sudoer文件,使得能够使用sudo命令
su  (切换到root用户下);
输入root用户密码;
ls -l /etc/sudoers (查看sudoers文件)
chmod u+w /etc/sudoers(给root用户增加写权限);
ls -l /etc/sudoers (查看sudoers文件)
vim /etc/sudoers(打开sudoers文件)然后在 root ALL=(ALL) ALL 后面加上 XXX ALL = (ALL) ALL,其中XXX表示你的用户名,保存之后推出
chmode u-w /etc/sudoers (恢复sudoers文件原来的读写权限)
ls -l /etc/sudoers (查看sudoers文件)
exit(退出root用户)
如此,就可以在xxx用户下使用sudo来做root权限的事情啦
Copy after login

2) is not in the sudoers file

Solution:

1) Switch to root identity (su: Just switch to root, and do not pass the root environment variables to it, su -: Put the environment variables together Bring it over, just like root login)

直接执行命令:
    visudo 
复制root的配置
root ALL=(ALL) ALL
例如添加lanlang
lanlang ALL=(ALL) ALL
Copy after login

2) Directly add the user to the wheel user group

usermod -a -G wheel lanlang
-a: 追加的方式添加, 不会删除掉之前所属的用户组
-G: 执行要添加的用户组
Copy after login

3) Add a new user and add it to /etc as a group /sudoers, and finally add a user to this group

useradd sudogroup
echo "%sudogroup  ALL=(ALL)   ALL">> /etc/sudoers
useradd xing
usermod -aG sudogroup xing
Copy after login

3. When using su to switch users, it becomes -bash4.1-$

Cause exploration:

  1) There is no relevant environment configuration file (.bash_logout .bash_profile, .bashrc) in the user's home directory

   2) The user's home directory is inconsistent with the one when added,

Solution:

1) Copy the user environment configuration file of /etc/skel to the specified directory

cp -a /etc/skel/. /home/lanlang
注意: skel/ 目录中的点不能丢哦
Copy after login

2) Migration operation is required

usermod -md /tmp/lanlang lanlang
-d: 修改用户端额家目录通常和-m一起使用
-m: 修改用户家目录通常和-d一起使用
Copy after login

4. Create user , only the $ symbol is displayed when logging in (Ubuntu)

Solution: You need to create a user and create the corresponding permissions and directory

adduser  lanlang
Copy after login

5. -bash: warning: setlocale: LC_CTYPE: cannot change locale ( UTF-8):

Solution: vim /etc/environment

LANG=en_US.utf-8
LC_ALL=en_US.utf-8
Copy after login

Configuration takes effect: source /etc/environment

6.nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)

Solution: Forcefully close the interface occupying process

sudo fuser -k 80/tcp #关闭占用80端口的程序
Copy after login

7. After Tencent Cloud resets the service, it cannot be used with ssh or connection tools. Connect

Solution: Delete invalid key

ssh-keygen -R "you server hostname or ip"
Copy after login

8. grep command prompts Binary file jzl_search_stdout.log matches

Solution:

grep -nr -a "400" jzl_search_stdout.log
-a, --text equivalent to --binary-files=text,即让二进制文件等价于文本。
Copy after login

Recommended tutorial: "linux tutorial"

The above is the detailed content of What are the common errors in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

Can mysql run on android Can mysql run on android Apr 08, 2025 pm 05:03 PM

MySQL cannot run directly on Android, but it can be implemented indirectly by using the following methods: using the lightweight database SQLite, which is built on the Android system, does not require a separate server, and has a small resource usage, which is very suitable for mobile device applications. Remotely connect to the MySQL server and connect to the MySQL database on the remote server through the network for data reading and writing, but there are disadvantages such as strong network dependencies, security issues and server costs.

Unable to access mysql from terminal Unable to access mysql from terminal Apr 08, 2025 pm 04:57 PM

Unable to access MySQL from the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.

What is the most use of Linux? What is the most use of Linux? Apr 09, 2025 am 12:02 AM

Linux is widely used in servers, embedded systems and desktop environments. 1) In the server field, Linux has become an ideal choice for hosting websites, databases and applications due to its stability and security. 2) In embedded systems, Linux is popular for its high customization and efficiency. 3) In the desktop environment, Linux provides a variety of desktop environments to meet the needs of different users.

CentOS Interview Questions: Ace Your Linux System Administrator Interview CentOS Interview Questions: Ace Your Linux System Administrator Interview Apr 09, 2025 am 12:17 AM

Frequently asked questions and answers to CentOS interview include: 1. Use the yum or dnf command to install software packages, such as sudoyumininstallnginx. 2. Manage users and groups through useradd and groupadd commands, such as sudouseradd-m-s/bin/bashnewuser. 3. Use firewalld to configure the firewall, such as sudofirewall-cmd--permanent-add-service=http. 4. Set automatic updates to use yum-cron, such as sudoyumininstallyum-cron and configure apply_updates=yes.

How to learn Linux basics? How to learn Linux basics? Apr 10, 2025 am 09:32 AM

The methods for basic Linux learning from scratch include: 1. Understand the file system and command line interface, 2. Master basic commands such as ls, cd, mkdir, 3. Learn file operations, such as creating and editing files, 4. Explore advanced usage such as pipelines and grep commands, 5. Master debugging skills and performance optimization, 6. Continuously improve skills through practice and exploration.

Key Linux Operations: A Beginner's Guide Key Linux Operations: A Beginner's Guide Apr 09, 2025 pm 04:09 PM

Linux beginners should master basic operations such as file management, user management and network configuration. 1) File management: Use mkdir, touch, ls, rm, mv, and CP commands. 2) User management: Use useradd, passwd, userdel, and usermod commands. 3) Network configuration: Use ifconfig, echo, and ufw commands. These operations are the basis of Linux system management, and mastering them can effectively manage the system.

Cannot start mysql in xampp Cannot start mysql in xampp Apr 08, 2025 pm 03:15 PM

There are many reasons why XAMPP fails to start MySQL, including port conflicts, configuration file errors, insufficient system permissions, service dependency issues, and installation issues. The troubleshooting steps are as follows: 1) Check port conflicts; 2) Check configuration files; 3) Check system permissions; 4) Check service dependencies; 5) Reinstall MySQL. Follow these steps and you can find and resolve issues that cause MySQL startup to fail.

See all articles