wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/DesktopEnvironment/Apt/Xfce4/de-apt-xfce4.sh && bash de-apt-xfce4.sh
使用上面命令在虚拟的ubutun中安装桌面,结果中断了,再更新出现如下问题
sudo apt-get update
命中:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
命中:2 http://cn.archive.ubuntu.com/ubuntu bionic InRelease
命中:3 http://cn.archive.ubuntu.com/ubuntu bionic-updates InRelease
命中:4 http://cn.archive.ubuntu.com/ubuntu bionic-backports InRelease
正在读取软件包列表... 有错误!
E: flAbsPath on /var/lib/dpkg/status failed - realpath (2: 没有那个文件或目录)
E: 无法打开文件 - open (2: 没有那个文件或目录)
E: Problem opening
E: 无法解析或打开软件包的列表或是状态文件。
sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates} sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
我这里没有dpkg.status.0文件,但有status-new文件,用这个也可以把它改成status就可以了
cd /var/lib/dpkg/
chmod 777 status-new
cp ./status-new status
su apt-get download dpkg dpkg -i dpkg*.deb apt-get download base-files dpkg -i base-files*.deb apt-get update apt-get check