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 "
else
# print package name red if not in default repo
echo -e "${RED}${line}${NC}"
fi
done < $input
Here 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/status
When 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?