9

Is there a way to see whether any one application was installed via Snap, from a PPA, via downloaded deb or from a standard repository?

At the moment, I have Zoom installed on my Focal 20.04 laptop. I'm trying to figure out how I initially installed it, but I have this problem fairly often. Either it's a proprietary app (eg. Slack or Dropbox) and I want to update it, or the app is alerting me that a newer version is available (Keepass) and I want to doublecheck that I installed from a repository and can just wait for the repo to be updated.

If I had to guess, I'd say it's likely that I installed Zoom from a downloaded .deb, but I'm not sure how to check. I don't think I installed Slack from a .deb.

I tried to follow some of the suggestions at How do I find out which repository a package comes from? but the results are ambiguous. For instance there's no apt policy result for Slack:

amanda@rajje:~$ apt policy slack
slack:
  Installed: (none)
  Candidate: 1:0.15.2-9
  Version table:
     1:0.15.2-9 500
        500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages

Presumably because I installed it from Ubuntu Software, so it's a Snap: Screenshot of Slack entry

If I try apt policy for an app that I know I haven't done any monkeying with I see a list of repositories. Can I assume that this means that I did install from a repository?

amanda@rajje:~$ apt policy emacs
emacs:
  Installed: 1:26.3+1-1ubuntu2
  Candidate: 1:26.3+1-1ubuntu2
  Version table:
 *** 1:26.3+1-1ubuntu2 500
        500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu focal/universe i386 Packages
        100 /var/lib/dpkg/status

And if no repository is shown, does that mean that I installed from a package download?

amanda@rajje:~$ apt policy zoom
zoom:
  Installed: 5.0.403652.0509
  Candidate: 5.0.403652.0509
  Version table:
 *** 5.0.403652.0509 100
        100 /var/lib/dpkg/status
Amanda
  • 9,333

3 Answers3

5

Start with which zoom or which zoom-client. That will return the file-path to the executable. (Hint: tab completion is your friend)

Anything that starts with /snap was installed by Snap (Or the Ubuntu Software Center) so you can find out more by opening the software center or running snap list | grep -i zoom to get full/correct Snap name.

If it starts with /usr/bin it was probably installed with apt or Synaptic. In that case dpkg -l | grep -i zoom or apt policy zoom* will tell you more. Look at the "Installed (Local or Obsolete)" filter in Synaptic to see whether something installed by apt was local or via a repository.

You may also want to check for:

  • Flatpak - check with flatpak list | grep -i zoom
  • Ubuntu Make - check with umake --list-installed (For example, IDEs)
Amanda
  • 9,333
N0rbert
  • 99,918
  • This is very helpful. which hadn't occurred to me as a way to differentiate Snaps from things installed with apt / Synaptic. But dpkg doesn't show me whether I installed from a local file or a repository. I think apt-cache policy is telling me there's no repo associated with Zoom, so I can assume that was installed from a local package. – Amanda Sep 24 '21 at 21:12
  • I couldn't believe I just downloaded zoom as a .deb file. I cancelled installation on reading this post and then it wouldn't let me install after that. All the while my version in the command line told me I hadn't updated: ii zoom 5.10.4.2845. Ubuntu Software was saying I had 5.11. I had to uninstall before I could install to make it right. dpkg -l, and these heuristics, are a good answer. I like the question more as I didn't know about apt policy before. – John Sep 05 '22 at 14:47
2

Install Synaptic Package Manager (you can install it from Ubuntu Software, or from command line using sudo apt install synaptic). It is a great tool to manage .deb packages. On the main screen, it shows you packages divided into groups, as you can see in the screenshot below. Look at group called "Installed (local or obsolete)" - these are packages that have been installed from manually downloaded files and not from repositories (some very essential system packages, like libc, are also included there). On my screenshot you can see zoom among those packages.

enter image description here

BTW. In your Slack example, the program is installed as snap, not a .deb package, which can be recognized by the presence of "Channel" at the beginning of the data on your screenshot. Snap packages always have a channel (usually latest/stable) while .deb packages don't. So neither apt nor Synaptic won't know anything about that package (in fact, in your example apt policy is showing you information about a non-installed slack package available to install as .deb from the repositories).

raj
  • 10,353
  • Hmm. So anything in "Installed (local or obsolete)" will be something I installed from a local file, rather than from a repository? – Amanda Sep 24 '21 at 21:03
  • @Amanda As I wrote, some default system libraries are included in that category too. But otherwise yes. It may be also something you installed from a repository, but it's not available in repository anymore (that means "obsolete" in this context). – raj Sep 25 '21 at 21:07
-1

This is way past the date that this was asked, but I quickly created a script (this morning) to search for apps in both repos and snap at the same time, and to query for an installed app with it's source.

If anyone finds it useful, here's the git repo:

https://github.com/rabinnh/uni-pkg-util/tree/main

  • 1
    Please include in the answer more details about your script - how to install it, how to use it, what the output looks like. – muru Mar 12 '24 at 04:42