Ubuntu20,21软件添加与删除历史记录以及还原
软件安装记录
一个非常头疼的就是安装新软件又无法使用。需要看看它安装什么软件后卸载。此时需要查看记录。
或者不小心卸掉什么以及其关联项。autoremove时常有问题。卸载掉应用的依赖项。
查看
vim /var/log/apt/history.log
重新安装
awk '!/^Start|^Commandl|^End|^Upgrade:|^Error:/ { gsub( /\([^()]*\)/ ,"" );gsub(/ ,/," ");sub(/^Install:/,""); print}' /var/log/apt/history.log
sudo apt-get install [packages]
https://serverfault.com/questions/380856/how-to-undo-apt-get-remove
grep "install " /var/log/dpkg.log
https://www.linuxuprising.com/2019/01/how-to-show-history-of-installed.html
后记
历史记录里面不包含dpkg和软件中心安装的记录,以及网上下载后安装的deb文件。
不知道为什么会悄悄安装新立得软件中心synaptic,imagemagic绘画软件。