Is there a way to get the names of all installed packages that are not installed from repositories listed in /etc/apt/sources.list ? Or get the name of all packages that were installed locally(using dpkg -i) and not from any repository ?
The easiest and most convenient way to do that is to use the new
apt list --installed | grep installed,local
The first command lists you all installed packages on the system. After each package there is a tag, which is
[installed,local] if the package was installed locally from a
From the comments:
aptitude search ~o
This command can work only if the locally installed packages don't have any repository added. And nowadays many of the packages add their own repository for updates, so with this command you might miss a lot of locally installed packages.