
아무것도 다운로드할 수 없거나 시스템을 업그레이드할 수 없습니다. 다음과 같은 오류 메시지가 나타납니다.
dpkg: file triggers record mentions illegal package name `doc-base/noawait' (for interest in file `/usr/share/doc-base'): character `/' not allowed (only letters, digits and characters `-+._')
E: Sub-process /usr/bin/dpkg returned an error code (2)
또한 시스템이 부트로더를 로드하지 못하기 때문에 USB 생성기를 사용하여 새로 설치할 수 없습니다.
도와주세요
답변1
다음 코드를 사용해 보세요:
#!/bin/bash
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"
if [ $USER != root ]; then
echo -e $RED"Error: must be root"
echo -e $YELLOW"Exiting..."$ENDCOLOR
exit 0
fi
clear
echo -e $YELLOW"Cleaning apt cache..."$ENDCOLOR
aptitude clean
echo -e $YELLOW"Removing old config files..."$ENDCOLOR
sudo aptitude purge $OLDCONF
clear
echo -e $YELLOW"Removing old kernels..."$ENDCOLOR
sudo aptitude purge $OLDKERNELS
echo -e $YELLOW"Emptying the trash..."$ENDCOLOR
rm -rf /home/*/.local/share/Trash/*/** &> /dev/null
rm -rf /root/.local/share/Trash/*/** &> /dev/null
다른 이름으로 저장하세요 troubleshooter.sh
.
그런 다음 다음 명령을 사용하십시오.
chmod 700 troubleshooter.sh
sudo ./troubleshooter.sh
그 후에 무슨 일이 일어나는지 알려주세요.