0

Is there any way to find out the URL (or atleast the apt source file) that is used to install a particular package? For instance, how would I know if VSCode was downloaded from https://packages.microsoft.com/repos/code ?

root@cc44dbebec72:/# tail /etc/apt/sources.list.d/vscode.list
deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main
root@cc44dbebec72:/# tail /etc/apt/sources.list.d/yarn.list
deb https://dl.yarnpkg.com/debian/ stable main
sidgate
  • 103

1 Answers1

1

You can use

apt policy ubuntu-desktop

to get details of what sources exist on your machine that can provide that package... HOWEVER if the package was manually installed from a 3rd party source without source (ie. dpkg -i install), OR was from a source that was later removed, it won't provide details of where it came from...

eg.

guiverc@d7050-next:~$   apt policy ubuntu-desktop
ubuntu-desktop:
  Installed: 1.541
  Candidate: 1.541
  Version table:
 *** 1.541 500
        500 http://archive.ubuntu.com/ubuntu oracular/main amd64 Packages
        100 /var/lib/dpkg/status

That apt policy command shows me the version I have installed, and a source that matches that install, so I have some assurance that I can see where it's come from... but there is no guarantee that it wasn't manually installed OR from another source that was removed from my sources prior to me running that command.

( Please note I don't use vscode, so I'll use a different package I do have installed as example here )

guiverc
  • 33,561