apt remove 和 purge 的区别
apt-get remove packagename
will remove the binaries, but not the configuration or data files of the package packagename. It will also leave dependencies installed with it on installation time untouched.
apt-get purge packagename or apt-get remove --purge packagename
will remove about everything regarding the package packagename, but not the dependencies installed with it on installation. Both commands are equivalent.
Particularly useful when you want to 'start all over' with an application because you messed up the configuration. However, it does not remove configuration or data files residing in users home directories, usually in hidden folders there. There is no easy way to get those removed as well.
apt-get autoremove
removes orphaned packages, i.e. installed packages that used to be installed as an dependency, but aren't any longer. Use this after removing a package which had installed dependencies you're no longer interested in.
apt-get install 和 apt install 的区别
apt-get 会保留下载安装包在 /var/cache/apt/archives
apt install不保留安装包
snap 和 apt 的区别
Snap和APT是Linux系统中两种不同的包管理工具,它们在软件来源、更新机制、依赖关系处理、软件选择、接口和权限、以及系统兼容性等方面存在显著差异。
软件来源与维护:
APT的软件包存储在Ubuntu的官方仓库中,由Canonical及社区维护。
Snap的软件包存储在snapcraft.io网站,任何人都可以发布自己的Snap软件包。
更新机制:
APT的软件更新跟随系统发布周期,比较稳定但不够及时。
nap的软件可以自动快速更新,支持多个发布通道,及时提供新功能和修复。
依赖关系管理:
APT管理的软件包需要处理软件之间的依赖关系,并确保它们都可用。
Snap通过将应用程序及其依赖项捆绑到一个独立的Snap软件包中来解决依赖问题,使每个软件相对隔离,避免依赖地狱。
软件选择:
APT拥有大量经过官方认证的软件包。
Snap数量更多,但存在不成熟的软件包。
接口和权限:
APT软件可以访问系统资源和硬件。
Snap软件默认被沙箱化,需要通过接口才能访问特定资源。
系统兼容性:
APT是Debian及其衍生系统(如Ubuntu)的标准包管理器,广泛兼容于这些系统。
Snap虽然最初是为Ubuntu设计的,但现在可以在所有流行的Linux系统上进行配置和使用,包括RedHat和OpenSUSE
ubuntu升级特定版本kernel
查看当前kernel版本:uname -a 或者 uname -r
列出所有kernel:sudo apt list linux-*image-* | grep generic
安装特定版本kernel: sudo apt install linux-image-5.15.0-101-generic
获取kernel顺序:sudo grub-mkconfig | grep -iE "menuentry 'Ubuntu, with Linux" | awk '{print i++ " : "$1, $2, $3, $4, $5, $6, $7}'
编辑grub文件: sudo vim /etc/default/grub
1>4 的意思是1级菜单选第2个,二级菜单选第4项,如下:
1级菜单
二级菜单
保存:sudo update-grub
然后:reboot