我在我的 Linux Mint 22(Ubuntu Noble 基础)上保留了一个程序的残余配置。
这是因为我不知道如果清除旧版本会发生什么,我的意思是这样的:
sudo apt-get purge virtualbox-7.0
当前版本 (7.1) 不会受到影响吗?还是相反,即它会删除所有virtualbox
配置?
apt
请问此操作的(默认)行为是什么?
以下是版本列表:
$ apt list -a virtualbox-7.1
virtualbox-7.1/unknown,now 7.1.4-165100~Ubuntu~noble amd64 [installed]
$ apt list -a virtualbox-7.0
virtualbox-7.0/unknown 7.0.22-165102~Ubuntu~noble amd64 [residual-config]
virtualbox-7.0/now 7.0.20-163906~Ubuntu~noble amd64 [residual-config]
这将是评论部分:
第一个请求来自 Stephen Kitt,谢谢。
$ dpkg -L virtualbox-7.0
Package virtualbox-7.0 does not contain any files (!)
$ ll /var/lib/dpkg/info/virtualbox-7.0.*
-rw-r--r-- 1 root root 0 2024-Sep-12 /var/lib/dpkg/info/virtualbox-7.0.list
-rwxr-xr-x 1 root root 2,1K 2024-Jul-11 /var/lib/dpkg/info/virtualbox-7.0.postrm
该.postrm
文件包含:
#!/bin/sh
# $Id: postrm 155244 2023-01-17 14:15:46Z bird $
## @file
# VirtualBox post remove.
#
# License and other commentary redacted for shortness.
if [ "$1" = "purge" -a ! -f /etc/init.d/vboxdrv ] ; then
update-rc.d vboxdrv remove >/dev/null || exit $?
fi
if [ "$1" = "purge" -a ! -f /etc/init.d/vboxnet ] ; then
update-rc.d vboxnet remove >/dev/null || exit $?
fi
if [ "$1" = "purge" -a ! -f /etc/init.d/vboxweb-service ] ; then
update-rc.d vboxweb-service remove >/dev/null || exit $?
fi
if [ "$1" = "purge" -a ! -f /etc/init.d/vboxballoonctrl-service ] ; then
update-rc.d vboxballoonctrl-service remove >/dev/null || exit $?
fi
# remove installed extension packs
if [ "$1" = "purge" ]; then
rm -rf /usr/lib/virtualbox/ExtensionPacks/*
fi
# Automatically added by dh_installdebconf/13.14.1ubuntu5
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section
exit 0