How does Ubuntu automatically obtain the lost PPAGPG key?

Source: Internet
Author: User
Many articles about Ubuntu on the Internet (including ours) allow you to add PPA to get the latest version of the application. PPA is very useful, but it is not easy to deal with the loss of PPA keys. To obtain the PPA key, you usually have to go to the terminal to beat independent commands for each lost PPA key. If you lose a lot of PPA keys, it will take some time. I hope there is a simple way. For example, there is a way to automatically complete this job. There is something like this. If you

Many articles about Ubuntu on the Internet (including ours) allow you to add PPA to get the latest version of the application. PPA is very useful, but it is not easy to deal with the loss of PPA keys.

To obtain the PPA key, you usually have to go to the terminal to beat independent commands for each lost PPA key. If you lose a lot of PPA keys, it will take some time.

I hope there is a simple way. For example, there is a way to automatically complete this job.

There is something like this. If you lose some PPA keys, such as @ _ honza (one of my readers), you can simply paste the following interrupt command to complete the work you need to do.

Sudo apt-get update 2>/tmp/keymissing;

For key in $ (grep "NO_PUBKEY"/tmp/keymissing | sed "s/. * NO_PUBKEY //"); do

Echo-e "nProcessing key: $ key ";

Gpg -- keyserver subkeys.pgp.net -- recv $ key & gpg -- export -- armor $ key | sudo apt-key add -;

Done

A simpler (more automated) Way to get lost PPA keys is to run a small script called launchpad-update when you update your software source.

First download launchpad-update to the desktop, right-click the file, and select the "Allow executing file as program" check box in "Properties. Then run the following command:

Cd Desktop
Sudo mv launchpad-update/usr/bin
Echo "APT: Update: Pre-Invoke {\" if [-x/usr/bin/launchpad-update]; then/usr/bin/launchpad-update; fi; \ "};"> 05ppa
Sudo mv 05ppa/etc/apt. conf. d/

Now, whenever you update your software source, it will automatically help you get the lost ppa gpg key. You can also manually run "launchpad-update" when you want to obtain the key ".

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.