Ubuntu14 Could not open file /var/lib/dpkg/status - open
如果不小心删除了/var/lib/dpkg下的所有文件,可以尝试如下的解决方案:
1.如果连dpkg目录都删除了,首先建立目录 mkdir /var/lib/dpkg
2.将机器中自带的dpkg的status备份文件拷贝到/var/lib/dpkg/status
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
3.在/var/lib/dpkg目录下建立如下文件或文件夹
文件:
touch available status-old available-old lock status
文件夹:
mkdir alternatives info parts updates triggers
4.sudo apt-get update
5 scp -r jenkins@TestSlave1:/var/lib/dpkg/* ./