Add new functionality to easily check lost public key

Bug #586368 reported by Ding Zhou
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Tweak
Confirmed
Medium
Ding Zhou

Bug Description

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!

Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → TualatriX (tualatrix)
milestone: none → 0.5.5
Revision history for this message
Marcelo Ruiz (marcelo-javier-ruiz-yahoo) wrote :

Thanks for your answer. I have no knowledge of how the script works... but I guess it can be improved somehow cause its not 100% effective.
For those keys it can not import, I use the following two commands that work:

gpg --keyserver subkeys.pgp.net --recv {KEY HERE}
gpg --export --armor {KEY HERE} | sudo apt-key add -

I bet you know how to replace the commands in the script to use these commands that proved to work all the time.
Again, thanks for your answer and congratulations for the great job!

Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
milestone: 0.5.5 → 0.5.6
Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
milestone: 0.5.6 → 0.5.7
Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
milestone: 0.5.7 → 0.6.0
Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
milestone: 0.6.0 → 0.7.0
Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
milestone: 0.7.0 → 0.8.0
Ding Zhou (tualatrix)
Changed in ubuntu-tweak:
milestone: 0.8.0 → 0.9.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.