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 / 930429
Accepted
Ravexina
Ravexina
Asked: 2017-06-30 12:26:32 +0800 CST2017-06-30 12:26:32 +0800 CST 2017-06-30 12:26:32 +0800 CST

Obtenha o URL dos pacotes instalados usando o apt

  • 772

Como você deve saber, podemos usar apt-get install --print-uris -y package-namee nos mostrar uma lista de URLs, hashsum, etc.

No entanto, se o usarmos para um pacote que já foi instalado no sistema, ele não funcionará:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
package is already the newest version (x.x-x).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Então, como posso obter uma lista de URLs necessários usando aptou outras ferramentas CLI como aptitude?

PS: Não quero usar packages.ubuntu.com .

apt
  • 2 2 respostas
  • 15470 Views

2 respostas

  • Voted
  1. Best Answer
    muru
    2017-06-30T14:22:52+08:002017-06-30T14:22:52+08:00

    Nem todos os pacotes instalados terão um URL associado a eles, é claro. No entanto, você poderia usar apt-get dowload:

    $ apt-get download --print-uris wget
    'http://archive.ubuntu.com/ubuntu/pool/main/w/wget/wget_1.15-1ubuntu1.14.04.2_amd64.deb' wget_1.15-1ubuntu1.14.04.2_amd64.deb 270522 SHA256:a3f3b049ea373402236a804a5a0952c6ef9b356ba8cc19fbc1f257db6e8f3052
    

    Esta é a versão candidata mostrada por apt-cache policy, que pode não ser necessariamente a versão instalada.

    • 11
  2. steeldriver
    2017-07-01T10:58:27+08:002017-07-01T10:58:27+08:00

    Parece ser suficiente adicionar o --reinstallsinalizador (pelo menos no meu sistema 16.04), por exemplo

    $ sudo apt-get install --print-uris wget
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    wget is already the newest version (1.17.1-1ubuntu1.2).
    wget set to manually installed.
    0 upgraded, 0 newly installed, 0 to remove and 73 not upgraded.
    

    mas

    $ sudo apt-get install --reinstall --print-uris wget
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 73 not upgraded.
    Need to get 298 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    'http://ca.archive.ubuntu.com/ubuntu/pool/main/w/wget/wget_1.17.1-1ubuntu1.2_amd64.deb' wget_1.17.1-1ubuntu1.2_amd64.deb 298270 MD5Sum:09a54f8d74c78598f91c4b376f3d2f0e
    

    NOTA: isso não funciona se o pacote estiver armazenado em cache:

    $ sudo apt-get install --reinstall --download-only wget
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 73 not upgraded.
    Need to get 298 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Get:1 http://ca.archive.ubuntu.com/ubuntu xenial-updates/main amd64 wget amd64 1.17.1-1ubuntu1.2 [298 kB]
    Fetched 298 kB in 0s (382 kB/s)
    Download complete and in download only mode
    
    $ sudo apt-get install --reinstall --print-uris wget
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 73 not upgraded.
    Need to get 0 B/298 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    

    mas depois de limpar o cache

    $ sudo apt-get clean
    $ sudo apt-get install --reinstall --print-uris wget
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 73 not upgraded.
    Need to get 298 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    'http://ca.archive.ubuntu.com/ubuntu/pool/main/w/wget/wget_1.17.1-1ubuntu1.2_amd64.deb' wget_1.17.1-1ubuntu1.2_amd64.deb 298270 MD5Sum:09a54f8d74c78598f91c4b376f3d2f0e
    
    • 4

relate perguntas

  • Como posso ver todas as versões de um pacote que estão disponíveis no arquivo?

  • Como os PPAs podem ser removidos?

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