I want to remove the package, but I forgot how I installed it through dpkg
or apt-get
I try to check through dpkg-query -list | grep myPackage
and apt list --installed | grep myPackage
, but myPackage was shown on both.
so how can I tell whether the package was installed by dpkg or apt ?
In order to do the correct uninstall command, like: apt-get remove
or dpkg -r
Best Answer
Compare the log of
/var/log/apt/term.log
, which is the log file generated byapt
and/var/log/dpkg.log
, which is the log file generated bydpkg
. If you note a package name which can be found in/var/log/dpkg.log
but not in/var/log/apt/term.log
, it is very likely that you installed the package bydpkg
that time.Please remember
apt
is a frontend fordpkg
. Thus, it is recommended to remove any package byapt
rather thandpkg
, becauseapt
will handle the dependency to remove those packages which will not be used by any other packages (, or mark them as "not use anymore" to let you remove them later. It depends on the exactapt
options you actually use). However, it is no harm to you to remove your package bydpkg
if you want. You will just likely leave many packages that you won't use anymore.