Skip to content

ALinux常见问题

Kervin edited this page Dec 9, 2021 · 6 revisions

问题1:error processing archive xxx (--install): 或error processing package xxx (--configure)

dpkg: error while cleaning up:
[dpkg]error processing archive rexray_0.9.1-1_amd64.deb (--install):
#或
error processing package dbconfig-common (--configure):

解决办法:

rm -rf  /var/lib/dpkg/info
mkdir -p /var/lib/dpkg/info
apt-get upgrade -y
apt-get install -f

问题2:清除buffer/cache

清除buffer/cache

解决办法:

echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
或
sysctl -w vm.drop_caches=1
sysctl -w vm.drop_caches=2
sysctl -w vm.drop_caches=3

问题3:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

解决办法:

rm /var/lib/dpkg/lock
dpkg --configure -a

问题4:远程能连上进不去

To escape to local shell, press 'Ctrl+Alt+]'

解决办法:

#添加路由
route add -net 172.21.0.0 netmask 255.255.0.0 gw 172.21.32.254
# 持久化(/etc/netplan/50-cloud-init.yaml)
dhcp4: true
addresses: [172.21.32.x/24]
gateway4: 172.21.32.254
nameservers:
    addresses:
routes:
    - to: 172.21.0.0/16
      via: 172.21.32.254

问题5:无法连接远程或内网端口

 Unable to connect to remote host: Connection refused

解决办法:

#查看对外暴露的IP以及端口
netstat -napt
#如果不存在,则删除对应路由,重新构建路由关系
route del default
route del -net 192.168.122.0 netmask 255.255.255.0
# 添加路由
route add -net 129.0.0.0 netmask 255.255.0.0 metric 50 vbr129
route add default gw 172.21.32.254
#删除网卡多余IP
ip addr del 172.21.32.43/24 dev ens3

问题6:KVM虚拟机CPU100%

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
36 root      20   0       0      0      0 S   100%   0.0   0:29.28 [ksoftirqd/4]

分析原因:

cat /proc/interrupts
#对CPU核过高的网卡进行关闭后重启
#深层次原因:带宽不够,发现当前带宽为100Mb/s,而服务器可以支持到1000Mb/s

解决办法:

#修改虚拟机带宽
virsh edit ics-server160
#修改网卡模式:--model=rtl8139 --> --model=e1000
virsh shutdown ics-server160
virsh start ics-server160

问题7:you might want to run 'apt-get -f install' to correct these

 you might want to run 'apt-get -f install' to correct these

解决办法:

apt-get --fix-broken install

问题8:cannot *********: Read-only file system

 cannot *********: Read-only file system

解决办法:

fsck.ext3 -y /dev/xvda2
mount -o  remount rw /

问题9:Sonar在docker中报错:FORBIDDEN/12/index read-only / allow delete (api)

 Sonar在docker中报错:FORBIDDEN/12/index read-only / allow delete (api)

原因:

docker所在服务器磁盘空间不足导致

解决办法:

docker system prune -a -f
#重启docker的容器

问题10:Failed to start XXX.service: Unit XXX.service is masked

 Failed to start docker-volume-netshare.service: Unit nfs-common.service is masked

解决办法:

rm /lib/systemd/system/nfs-common.service
systemctl daemon-reload
systemctl restart nfs-common
systemctl enable nfs-common
systemctl is-enabled nfs-common

问题11:[wget | curl]HTTP request sent, awaiting response... 403 Forbidden

 HTTP request sent, awaiting response... 403 Forbidden 

解决办法:

wget -U NoSuchBrowser/1.0 下载地址
#例如下载centos系统文件
wget -U NoSuchBrowser/1.0 https://mirrors.tuna.tsinghua.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
Clone this wiki locally