AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1407632
Accepted
heynnema
heynnema
Asked: 2022-05-10 13:12:32 +0800 CST2022-05-10 13:12:32 +0800 CST 2022-05-10 13:12:32 +0800 CST

A chave é armazenada no chaveiro legado trusted.gpg (/etc/apt/trusted.gpg)

  • 772

Acabei de atualizar do Ubuntu 21.10 para 22.04.

sudo apt updatetermina com os seguintes avisos...

W: https://linux.teamviewer.com/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://apt.keepsolid.com/ubuntu/dists/groovy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://linux.dropbox.com/ubuntu/dists/disco/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://download.virtualbox.org/virtualbox/debian/dists/hirsute/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://download.opensuse.org/repositories/home:/IBBoard:/cawbird/xUbuntu_22.04/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/solaar-unifying/stable/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

Synapticmostra os mesmos avisos em uma recarga.

A revisão man apt-keynão esclarece isso para mim.

Eu acho que isso ocorre porque o Ubuntu 22.04 fez a transição de usar /etc/apt/trusted.gpg para usar arquivos .gpg individuais localizados em /etc/apt/trusted.gpg.d.

Essas chaves podem ser convertidas de uma para outra ou devo excluí-las e reimportá-las?

gnupg
  • 6 6 respostas
  • 17165 Views

6 respostas

  • Voted
  1. Best Answer
    heynnema
    2022-05-21T17:13:21+08:002022-05-21T17:13:21+08:00

    A maneira fácil de corrigir essas mensagens de aviso geradas por sudo apt update...

    W: https://linux.teamviewer.com/deb/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://apt.keepsolid.com/ubuntu/dists/groovy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://linux.dropbox.com/ubuntu/dists/disco/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://download.virtualbox.org/virtualbox/debian/dists/hirsute/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://download.opensuse.org/repositories/home:/IBBoard:/cawbird/xUbuntu_22.04/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://ppa.launchpad.net/solaar-unifying/stable/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    W: http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    

    Nota : Essas mensagens de aviso podem ser geradas por qualquer repositório ou ppa ativadoSoftware & Updates na guia "Outro software".

    Correção de exemplo:


    Para esta mensagem de aviso com sudo apt update...

    W: http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    

    Procuramos sudo apt-key liste encontramos esta entrada para xbmc ...

    pub   rsa1024 2009-01-20 [SC]
          1897 01DA 570C 56B9 488E  F60A 6D97 5C47 91E7 EE5E
    uid           [ unknown] Launchpad PPA for XBMC for Linux
    

    Então convertemos esta entrada para um arquivo .gpg, usando os últimos 8 caracteres numéricos acima...

    sudo apt-key export 91E7EE5E | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/team-xbmc.gpg
    

    Repita os comandos acima para cada mensagem de aviso gerada pelo sudo apt update.

    Nota : Parcialmente retirado das respostas aceitas aqui e aqui .

    • 63
  2. JDMcMillian
    2022-06-25T19:35:57+08:002022-06-25T19:35:57+08:00

    Me deparei com esse problema depois de mudar para 22.04 e queria adicionar minha solução. Eu tinha muitas chaves que precisavam ser atualizadas/convertidas. Esta não é uma solução ideal, mas funciona bem.

    Um one-liner para converter todas as chaves obsoletas para o novo formato.

    POR FAVOR, TENHA TEMPO PARA ENTENDER O QUE VOCÊ ESTÁ FAZENDO AQUI ANTES DE EXECUTAR!! Verifique também se o seu bash não é muito antigo. Minha versão bash:GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

    for KEY in $( \
        apt-key list \
        | grep -E "(([ ]{1,2}(([0-9A-F]{4}))){10})" \
        | tr -d " " \
        | grep -E "([0-9A-F]){8}\b" \
    ); do
        K=${KEY:(-8)}
        apt-key export $K \
        | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/imported-from-trusted-gpg-$K.gpg
    done
    

    Explicação:

    1. Recupera a lista de chaves conhecidas.

    lista de chaves apt

    1. Encontre todo o agrupamento de caracteres hexadecimais que tenham 1 ou 2 espaços na frente e tenham 4 caracteres. Obtenha a coleção daqueles que têm 10 agrupamentos por linha. Isso fornece a assinatura de chave completa.

    grep -E "(([ ]{1,2}(([0-9A-F]{4}))){10})"

    1. Apare (exclua) todos os espaços em cada linha encontrada, para que a armadura de clave não seja interrompida por espaços em branco.

    tr -d " "

    1. Pegue os últimos 8 caracteres de cada linha.

    grep -E "([0-9A-F]){8}\b"

    Agora temos uma coleção de sufixos de chave, cada um com 8 caracteres de comprimento.

    1. Percorra cada sufixo de chave, colocando o sufixo atual na KEYvariável.

    para KEY em $(…); Faz

    1. Atribua os últimos 8 caracteres à variávelK

    K=${KEY:(-8)};

    1. Exporte a chave que corresponde à assinatura Ke passe/encaminhe-a gpgpara armazená-la adequadamente.

    apt-key export $K | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/imported-from-trusted-gpg-$K.gpg

    1. Faça um loop até que todas as chaves sejam processadas.

    feito

    1. Não aproveite mais avisos de depreciação.

    Agradecimentos especiais à heynnema, cuja solução está no centro disso.

    • 18
  3. mykahveli
    2022-06-21T03:58:14+08:002022-06-21T03:58:14+08:00

    O que funcionou para mim foi:

    mv /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/
    
    • 7
  4. Frank
    2022-08-03T23:24:53+08:002022-08-03T23:24:53+08:00

    Transformei a resposta de @heynnema em uma função, que você pode colocar .bashrcpor conveniência. Isso leva dois argumentos: a chave (últimos 8 caracteres) e o nome do arquivo de destino para o arquivo GPG de saída.

    function apt-key-migrate {
      typeset key="$1"
      typeset dest="$2"
    
      if [ -z "$key" ] || [ -z "$dest" ];
      then
        echo "Usage: apt-key-migrate <key> <destination>"
        return 1
      fi
    
      sudo apt-key export $key | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/$dest.gpg
    }
    

    Exemplo:apt-key-migrate 91E7EE5E team-xbmc

    • 1
  5. frank_108
    2022-06-16T22:57:26+08:002022-06-16T22:57:26+08:00

    apt-key está obsoleto e deve ser substituído a longo prazo no Ubuntu 22.04.

    Quando precisar, você pode excluir a chave existente com:

    apt-key list
    

    e

    apt-key del YOUR-KEY
    

    Importe sua chave com comandos como:

    curl https://yourrepo.com/repo.key | gpg --dearmor | sudo dd of=/usr/local/share/keyrings/your-repo.gpg
    

    Adicione a assinatura a /etc/apt/sources.list.d/your.list

    deb [signed-by=/usr/local/share/keyrings/your-repo.gpg]  https://yourepo./ubuntu jammy main
    

    Mais detalhes no manual:
    link

    Bons detalhes aqui também: link

    • 0
  6. brvoisin
    2022-09-01T00:27:12+08:002022-09-01T00:27:12+08:00

    Modifiquei a função do @Frank para remover a chave do legado trusted.gpg para evitar duplicação.

    function apt-key-migrate {
        typeset key="$1"
        typeset dest="$2"
    
        if [ -z "$key" ] || [ -z "$dest" ];
        then
            echo "Usage: apt-key-migrate <key> <destination>"
            return 1
        fi
    
        sudo apt-key --keyring /etc/apt/trusted.gpg export $key | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/$dest.gpg
        sudo apt-key --keyring /etc/apt/trusted.gpg del $key
    }
    
    • 0

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve