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
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
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权限的事情啦
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
2) Directly add the user to the wheel user group
usermod -a -G wheel lanlang -a: 追加的方式添加, 不会删除掉之前所属的用户组 -G: 执行要添加的用户组
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
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/ 目录中的点不能丢哦
2) Migration operation is required
usermod -md /tmp/lanlang lanlang -d: 修改用户端额家目录通常和-m一起使用 -m: 修改用户家目录通常和-d一起使用
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
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
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端口的程序
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"
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,即让二进制文件等价于文本。
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!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



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.

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 the terminal may be due to: MySQL service not running; connection command error; insufficient permissions; firewall blocks connection; MySQL configuration file error.

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.

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.

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.

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.

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.
