How to get authentication key on ubuntu ?

we need to add different repository on software sourcelist .we need to add a authentication keys for the repositories.for that we need to add this below script on /bin/ folder.

#! /bin/sh
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

rename as launchpad-update

sudo chmod +x launchpad-update
sudo ./launchpad-update

Wallaaaaaaaaaa!!!!!!!!!!!!!!! you are done …

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.