Suggestion: new functionality -> No Public Key Founds

Asked by Marcelo Ruiz

Hi,

I think it will be useful if Ubuntu Tweak could check the source list file and automatically retrieve from the servers any (not just the ones provided by Ubuntu Tweak) missing public key to avoid that error when updating. I think this will be really useful for both new Ubuntu users and more advanced ones.

There is a script that I found on line that is supposed to do this, but I was lucky with just some of the repositories (it didn't work for the virtualbox one), but it might be a good starting point:

#! /bin/sh

# Script created by blackgr [ http://ubuntuforums.org/member.php?u=732179 ]
# originally downloaded from this webpage: [http://ubuntuforums.org/showpost.php?p=6700382&postcount=66 ]
# (in case you care or need someone to complain to) mirrored and distributed here http://www.stefanoforenza.com/solve-your-no_pubkey-ppas-in-a-snap-or-a-script
# License: unknown (my educated guess is it's in the Public Domain)

if [ "`whoami`" != "root" ];
then
echo "Please run with SUDO"
exit 1
fi
RELEASE=`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d"=" -f2`
echo Release: $RELEASE
echo Please Wait...
for q in `find /etc/apt/ -name *.list`; do
cat $q >> fullsourceslist
done
for i in `cat fullsourceslist | grep "deb http" | grep ppa.launchpad | grep $RELEASE | cut -d/ -f4`; do
 wget -q --no-check-certificate `wget -q --no-check-certificate https://launchpad.net/~$i/+archive -O- | grep "http://keyserver.ubuntu.com:11371/pks/" | cut -d'"' -f2 ` -O- | grep "pub " | cut -d'"' -f2 >> keyss
done
for j in `cat keyss` ; do
 wget -q --no-check-certificate "http://keyserver.ubuntu.com:11371$j" -O- | grep -B 999999 END |grep -A 999999 BEGIN > keyss2
 sudo apt-key add keyss2
 rm keyss2
done
rm keyss
rm fullsourceslist

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Tweak Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Ding Zhou (tualatrix) said :
#1

Thanks for the amazing script!

I will try integrate this script into the next version of Ubuntu Tweak.

Can you help with this problem?

Provide an answer of your own, or ask Marcelo Ruiz for more information if necessary.

To post a message you must log in.