Summary of linux common problems

table of Contents

1. Mount the ISO file

2.wget: command not found

3.determining if ip address is already in use

4. The problem of missing eth0 after cloning

6.You could try using --skip-broken to work around the problem

7. How to remove one more space in the file name?

8. Resolve package conflicts

9. The physical machine cannot be accessed after Tomcat is installed

10.Cannot retrieve repository metadata (repomd.xml) for repository: mysql-tools-community. Please verify its path and try again

11. E325: ATTENTION   Found a swap file by the name      ".nginx.conf.swp"

12.destination host unreachable

13.determining if ip address is already in use

14. Ping cannot connect to the external network

15. Modify the login password

16.-bash: scp: command not found


1. Mount the ISO file

1) Mount the ISO image file to /media/cdrom/ (copying will waste space)
ll /dev/cdrom (view device)
mkdir /mnt/cdrom (create a folder, in terms of mounting the ISO image)
mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom (first there must be a disk under /dev/cdrom)

 

2) Set up to automatically mount
vi /etc/fstab and
add the following content:
/dev/cdrom /mnt/cdrom iso9660 defaults 0 0

3) Create a soft link
yum install httpd
service httpd start
cd /var/www/html
ln -s /mnt/cdrom ./centos  
4) Enter 192.168.1.11/centos in the browser address bar and the directory structure will appear (indicating successful configuration)
5) Modify the configuration of other machines:
cd /etc/yum.repos.d
cp CentOS-Media.repo CentOS-mini.repo
vi CentOS-mini.repo 
modify:
name=CentOS-$releasever-Media
baseurl=file:/// media/CentOS/
gpgcheck=1
enabled=0
amended to:
name=CentOS-mini
baseurl=http://centosmini/centos
gpgcheck=0
enabled=1
View:
yum clean all
yum repolist

2.wget: command not found

yum -y install wget

3.determining if ip address is already in use

vi /etc/sysconfig/network-scripts/ifcfg-eth0 加入:
ARPCHECK=no 

4. The problem of missing eth0 after cloning

Step 1: vi /etc/udev/rules.d/70-persistent-net.rules
delete eth0 and change eth1 to eth0
Step 2: vi /etc/sysconfig/network-scripts/ifcfg-eth0
delete UUID and HWADDR
Step 3: vi /etc/sysconfig/network Modify the host name
Step 4: Restart the system

5. MySQL only has information_schema database, Access denied for user'root'@'localhost' (using password: YES)

1)
Stop the MySQL service: /etc/init.d/mysqld stop
2) Use the safe mode to restart:
mysqld_safe --skip-grant-tables
3) Open another terminal, use the root account, and log in without a password:
mysql- u root
4) Select mysql database:
use mysql;
5) Change the password for the root user to: 123456 (set by yourself):
update user set password=PASSWORD("123456") where User ='root';
6) Stop MySQL service :
/Etc/init.d/mysqld stop
7) Restart the MySQL service:
/etc/init.d/mysqld start
8) Use the root account to log in normally:
mysql -u root -p

6.You could try using --skip-broken to work around the problem

1) Transfer all the repos files in the /etc/yum.repos.d folder, and then copy the repo used (make sure that the directory where the repo is located is only your 1 file) 
2) yum clean all 

7. How to remove one more space in the file name?

In the process of editing, Chinese spaces may be put in the file name.
Solution: add a backslash before the space, such as:
mv tomcat7\ tomcat7

8. Resolve package conflicts

rmp -e conflicting package name --nodeps

9. The physical machine cannot be accessed after Tomcat is installed

1: Add an open port 8080 (add protocol):
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
iptables -L -n (check firewall status)
Method 2: The main reason is that the Centos firewall is still open and needs to be closed
 Turn off the firewall instruction: /etc/init.d/iptables stop
 Permanently turn off the firewall instruction: chkconfig iptables off
 Turn on the firewall instruction: /etc/init.d/iptables start
 Permanently turn on the firewall instruction: chkconfig iptables on
 View the firewall status: /etc/init .d/iptables status

10.Cannot retrieve repository metadata (repomd.xml) for repository: mysql-tools-community. Please verify its path and try again

http://mirrors.163.com/.help/centos.html
1) First backup /etc/yum.repos.d/CentOS-Base.repo
    mv /etc/yum.repos.d/CentOS-Base.repo/ etc/yum.repos.d/CentOS-Base.repo.backup
2) Drag Centos-6.repo to the cd /etc/yum.repos.d/ directory
3) Run the following command to generate cache
yum clean all
yum makecache

11. E325: ATTENTION   Found a swap file by the name      ".nginx.conf.swp"

Since the last time the text was edited, it exited abnormally, so a .nginx.conf.swp file was generated, which is a hidden file, which can be listed through the ll -a command, and then delete it.

12.destination host unreachable

Configure local real network card and VMnet8 network card

http://blog.csdn.net/shadow_xwl/article/details/50509797

 

 

 

13.determining if ip address is already in use

Add under /etc/sysconfig/network-scripts/ifcfg-eth0:
ARPCHECK=no  

14. Ping cannot connect to the external network

1) Configure the local network card

 

2) Configure the virtual network card VMware Network Adapter VMnet8 network adapter IP settings and the virtual machine IP need to be in the same network segment

 

3) Configure virtual network DHCP

 

4) NAT settings:

5)修改/etc/sysconfig/network-scripts/ifcfg-eth0:


 
  
  
  1. DEVICE=eth 0 #Network card interface name  
  2. TYPE=Ethernet #Network card type is Ethernet
  3. ONBOOT=yes #Automatically activate the network card when the system starts
  4. NM_CONTROLLED= no  
  5. BOOTPROTO=none #There   are usually four types of protocols: static dhcp bootp none
  6. DEFROUTE = yes  
  7. PEERDNS=yes
  8. PEERROUTES=yes
  9. IPV4_FAILURE_FATAL=yes #Use   IPV4 protocol version
  10. IPV6INIT= no #Do not use IPV6 protocol version    
  11. NAME= "System eth0"
  12. = IPADDR 192.168 . 1.111 ip address of #linux  
  13. = GATEWAY 192.168 . 1.1 # Gateway    
  14. NETMASK = 255.255 . 255.0 #Subnet mask  
  15. DNS1= 114.114 . 114.114 #DNS server address  
  16. ARPCHECK= no  

6) Permanently turn off the firewall:
chkconfig iptables off
7) Add under /etc/resolv.conf:
nameserver 114.114.114.114 
nameserver 8.8.8.8
8)service network restart

9) If the above steps do not work, try another DNS.
For example: change 192.168.1.1 to 192.168.1.55 (maybe 192.168.1.1 is occupied by someone else). If the
host ip address is changed, you must also modify the linux ip address.

15. Modify the login password

passwd

16.-bash: scp: command not found

The scp command is to copy files remotely. The above situation is that a certain Linux does not have the package required for scp installed
. Find the package where scp is located on a normal CentOS 5.6 server:
# which scp 
/usr/bin/scp 
# rpm- qf /usr/bin/scp 
openssh-clients-4.3p2-72.el5

So it seems that the package where scp is located is openssh-clients.
Install it on an abnormal machine: the
code is as follows:

# yum install openssh-clients
or install  from the CD 
# rpm -ivh libedit-2.11-4.20080712cvs.1.el6.x86_64 
# rpm -ivh openssh-clients-5.3p1-20.el6.x86_64
At this point, the scp command can be executed .

For more information, please pay attention to the official account: The Road to a Master Programmer

Reply in the public account: linux    can get free linux video tutorial (unencrypted)!

 

table of Contents

Guess you like

Origin blog.csdn.net/D_J1224/article/details/107536059