I am using Ubuntu 20.04 and have a list of package names of which I want to check whether it is part of the default Ubuntu repository.
So far I am iterating over the list an check with the following script:
#!/bin/bash
input="modified_list.txt"
RED='\033[0;31m'
NC='\033[0m'
if [ ! -f $input ];
then echo -e "file does not exist: $input" exit 1
fi
while read -r line
do if [[ $(apt policy $line 2> /dev/null | grep 'focal' | wc -l) -gt 0 ]]; then # print package name normal if part of ubuntu default repo echo -e "$line\t" else # print package name red if not in default repo echo -e "${RED}${line}${NC}" fi
done < $inputHere I noticed the package xvnc4viewer is (according to the script) not part of the repository. When executing apt policy xvnc4viewer the terminal outputs:
xvnc4viewer: Installed: 4.1.1+xorg4.3.0-37.3ubuntu2 Candidate: 4.1.1+xorg4.3.0-37.3ubuntu2 Version table: *** 4.1.1+xorg4.3.0-37.3ubuntu2 100 100 /var/lib/dpkg/statusWhen using the command on other packages, I found an URL or something that helped me to figure out where the package comes from, but in this case I couldn't figure it out. Using apt-cache search xvnc4viewer the package is found but commands like apt-cache showpkg did not help me either. So, how do I figure out where the package is coming from?
4 Answers
The xvnc4viewer package was removed from the Ubuntu repositories after Ubuntu 18.04.
$ rmadison xvnc4viewer xvnc4viewer | 4.1.1+xorg4.3.0-37ubuntu5 | trusty/universe | amd64, armhf, i386, powerpc xvnc4viewer | 4.1.1+xorg4.3.0-37ubuntu5.0.2 | trusty-security/universe | amd64, arm64, armhf, i386, powerpc xvnc4viewer | 4.1.1+xorg4.3.0-37ubuntu5.0.2 | trusty-updates/universe | amd64, arm64, armhf, i386, powerpc xvnc4viewer | 4.1.1+xorg4.3.0-37.3ubuntu2 | xenial/universe | amd64, arm64, armhf, i386, powerpc, ppc64el, s390x xvnc4viewer | 4.1.1+xorg4.3.0-37.3ubuntu2 | bionic/universe | amd64, arm64, armhf, i386, ppc64el, s390x- The
rmadisoncommand is included with thedevscriptspackage. - You can get the same information in a different format by browsing
Note that the package is in the -universe pocket, and is still available for Ubuntu 18.04 (but not for newer releases). Universe packages are not part of a stock install of Ubuntu. They are still Ubuntu packages, and we still support them. They're just not included with the Ubuntu installer.
Also, keep in mind that doing a release-upgrade (from, say, 18.04 to 20.04) does NOT necessarily remove the older software. If a 20.04 package exists, it replaces the 18.04 package. If a 20.04 package does not exist, then then 18.04 package remains installed on the 20.04 system as long as it is compatible.
xvnc4viewer isn't part of the default repositories for Ubuntu 20.04 (Focal Fossa), but it is part of the default repositories for Ubuntu 18.04 (Bionic Beaver). The exact version of the package, 4.1.1+xorg4.3.0-37.3ubuntu2, also matches that. So I'd assume that the system in question has previously been running 18.04 and has been upgraded since.
apt policy only mentions repositories that currently are in the system's source list. So the system might previously have the repositories for Bionic set up, xvnc4viewer was installed from there, and later the Bionic repos were replaced with the Focal ones during an upgrade. In this case, the repository the package originally came from isn't in the source list any more, and apt policy can't list it.
The other possibility, as Artur Meinild already mentioned, is that the package was installed manually with dpkg, with apt never coming into play for this package.
Most likely, this package was downloaded and then installed manually with sudo apt install <package name>.
Searching the web for the package name, you can see that this version of the package was only available in the Bionic Universe repo.
You can't always see the origin of a manually downloaded package, so you have to resolve to other means than the apt utility.
As said by Artur Meinild, this package is only available for Ubuntu 18.04 bionic.
There can be two reasons for it to be in your system.
You installed the software after adding a PPA and changing its release name to focal.
This means that you installed this package using a custom PPA or that you built it from the source using any third-party dependencies or modified source code. After installing the software, you've removed the source/PPA for the package.You marked this package as manually installed. This means you were running Ubuntu 18.04 before upgrading to Ubuntu 20.04 with
do-release-upgrade. This package was supposed to be removed because it wasn't available for focal. However, it's possible that it was marked as a dependency or manually installed package. Dependencies and manually installed packages are not removed during this process. It's also possible that this was previously installed as a dependency for any custom package installed through a PPA or source repository (the PPA must be removed with the package itself and left this package as manually installed. Maybe it was marked manually installed by you? )