I am using Ubuntu 22.04. I know I can get the information about where a package comes from via apt-cache policy <package name> (related question). I want to find out how I installed a specific package (php8.3 to be specific) before. Therefore I issue this command:
apt-cache policy php8.3
I know that PHP 8.3 does not come with Ubuntu 22.04, therefore I would like to know where did it come from.
Output of the command above:
php8.3:
Installed: 8.3.2-1+ubuntu20.04.1+deb.sury.org+1
Candidate: 8.3.2-1+ubuntu20.04.1+deb.sury.org+1
Version table:
*** 8.3.2-1+ubuntu20.04.1+deb.sury.org+1 100
100 /var/lib/dpkg/status
root@yourappapp-vm:~# apt showpkg php8.3
E: Invalid operation showpkg
root@yourappapp-vm:~# apt-cache showpkg php8.3
Package: php8.3
Versions:
8.3.2-1+ubuntu20.04.1+deb.sury.org+1 (/var/lib/dpkg/status)
Description Language:
File: /var/lib/dpkg/status
MD5: 86488d7a405bdcbac9ece7c307f30abb
Reverse Depends:
php,php8.3
Dependencies:
8.3.2-1+ubuntu20.04.1+deb.sury.org+1 - libapache2-mod-php8.3 (16 (null)) php8.3-fpm (16 (null)) php8.3-cgi (0 (null)) php8.3-common (0 (null))
Provides:
8.3.2-1+ubuntu20.04.1+deb.sury.org+1 - php (= )
Reverse Provides:
It only mentions /var/lib/dpkg/status instead of the repository name. For other packages that come with Ubuntu 22.04, it will display the correct repository information:
# apt-cache showpkg openssl
Package: openssl
Versions:
3.0.2-0ubuntu1.15 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-updates_main_binary-amd64_Packages) (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-security_main_binary-amd64_Packages) (/var/lib/dpkg/status)
Description Language:
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_main_binary-amd64_Packages
MD5: 9b6de2bb6e1d9016aeb0f00bcf6617bd
Description Language: en
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_main_i18n_Translation-en
MD5: 9b6de2bb6e1d9016aeb0f00bcf6617bd
Description Language:
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-updates_main_binary-amd64_Packages
MD5: 9b6de2bb6e1d9016aeb0f00bcf6617bd
3.0.2-0ubuntu1 (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_main_binary-amd64_Packages)
Description Language:
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_main_binary-amd64_Packages
MD5: 9b6de2bb6e1d9016aeb0f00bcf6617bd
Description Language: en
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy_main_i18n_Translation-en
MD5: 9b6de2bb6e1d9016aeb0f00bcf6617bd
Description Language:
File: /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_jammy-updates_main_binary-amd64_Packages
MD5: 9b6de2bb6e1d9016aeb0f00bcf6617bd
Reverse Depends:
...(skipping the dependencies, too long)
My question is: how do I know which repository my PHP 8.3 comes from?
Here is my Source list:
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
/etc/apt/sources.list:deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
/etc/apt/sources.list:deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
/etc/apt/sources.list:deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
/etc/apt/sources.list:deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
/etc/apt/sources.list.d/digitalocean-agent.list:deb [signed-by=/usr/share/keyrings/digitalocean-agent-keyring.gpg] https://repos.insights.digitalocean.com/apt/do-agent main main
/etc/apt/sources.list.d/digitalocean-agent.list.distUpgrade:deb [signed-by=/usr/share/keyrings/digitalocean-agent-keyring.gpg] https://repos.insights.digitalocean.com/apt/do-agent main main
/etc/apt/sources.list.d/digitalocean-agent.list.save:deb [signed-by=/usr/share/keyrings/digitalocean-agent-keyring.gpg] https://repos.insights.digitalocean.com/apt/do-agent main main
/etc/apt/sources.list.d/droplet-agent.list:deb [signed-by=/usr/share/keyrings/droplet-agent-keyring.gpg] https://repos-droplet.digitalocean.com/apt/droplet-agent main main
/etc/apt/sources.list.d/droplet-agent.list.distUpgrade:deb [signed-by=/usr/share/keyrings/droplet-agent-keyring.gpg] https://repos-droplet.digitalocean.com/apt/droplet-agent main main
/etc/apt/sources.list.d/droplet-agent.list.save:deb [signed-by=/usr/share/keyrings/droplet-agent-keyring.gpg] https://repos-droplet.digitalocean.com/apt/droplet-agent main main
/etc/apt/sources.list.d/ondrej-ubuntu-apache2-focal.list.distUpgrade:deb http://ppa.launchpad.net/ondrej/apache2/ubuntu focal main
/etc/apt/sources.list.d/ondrej-ubuntu-php-focal.list.distUpgrade:deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main
/etc/apt/sources.list.d/ondrej-ubuntu-php-focal.list.save:deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main
/etc/apt/sources.list.d/ubuntu-esm-infra.list.save:deb https://esm.ubuntu.com/infra/ubuntu xenial-infra-security main
/etc/apt/sources.list.d/ubuntu-esm-infra.list.save:deb https://esm.ubuntu.com/infra/ubuntu xenial-infra-updates main