apt remove

manpage

執行

$ man apt

可以找到一段說明

install, remove, purge (apt-get(8))
    Performs the requested action on one or more packages specified via regex(7), glob(7) or exact match. The
    requested action can be overridden for specific packages by append a plus (+) to the package name to
    install this package or a minus (-) to remove it.

    A specific version of a package can be selected for installation by following the package name with an
    equals (=) and the version of the package to select. Alternatively the version from a specific release can
    be selected by following the package name with a forward slash (/) and codename (jessie, stretch, sid ...)
    or suite name (stable, testing, unstable). This will also select versions from this release for
    dependencies of this package if needed to satisfy the request.

    Removing a package removes all packaged data, but leaves usually small (modified) user configuration files
    behind, in case the remove was an accident. Just issuing an installation request for the accidentally
    removed package will restore its function as before in that case. On the other hand you can get rid of
    these leftovers by calling purge even on already removed packages. Note that this does not affect any data
    or configuration stored in your home directory.

help

執行

$ apt -h

可以找到一段說明

remove - remove packages

指令範例

執行

$ sudo apt remove hello

就會移除「hello」這個套件。

執行

$ dpkg -l hello

顯示

dpkg-query: no packages found matching hello

或是執行

$ dpkg --get-selections | grep hello

沒有任何顯示

或是執行

$ dpkg -s hello | grep Status:

顯示

dpkg-query: package 'hello' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.

執行

$ dpkg -L hello

顯示

dpkg-query: package 'hello' is not installed
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.