1、安装Ubuntu虚拟机时,内存需设置为主机内存的1/3,否则容易电脑卡死。
2、当执行spt-get安装时,出现“无法定位软件包”的提示时,输入:
sudo apt-get update
3、当出现无法获得锁 /var/lib/apt/lists/lock - open(11:资源暂时不可用),输入:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
4、实现虚拟机与win主机之间粘贴复制
https://blog.csdn.net/teacher20133/article/details/54601816
5、在运行sudo apt-get update时出现如下信息:
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success
'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli;
then appstreamcli refresh > /dev/null;
fi'
E: Sub-process returned an error code
解决方法如下:
sudo pkill -KILL appstreamcli
wget -P /tmp https://launchpad.net/ubuntu/+archive/primary/+files/appstream_0.9.4-1ubuntu1_amd64.deb https://launchpad.net/ubuntu/+archive/primary/+files/libappstream3_0.9.4-1ubuntu1_amd64.deb
sudo dpkg -i /tmp/appstream_0.9.4-1ubuntu1_amd64.deb /tmp/libappstream3_0.9.4-1ubuntu1_amd64.deb
执行完上述命令之后再次运行sudo apt-get update就不会再出现上面的错误。
E: 无法获得锁 /var/cache/apt/archives/lock - open (11: 资源暂时不可用)
E: 无法对目录 /var/cache/apt/archives/ 加锁
解决方法:
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
更新Ubuntu:
sudo apt upgrade
sudo apt autoremove