Ignora a seleção explícita do pacote (e força o download do mais recente)

1

Eu digito sudo apt-get install lua e recebo o seguinte:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package lua is a virtual package provided by:
  lua5.3:i386 5.3.1-1
  lua5.2:i386 5.2.4-1
  lua5.1:i386 5.1.5-8
  lua50 5.0.3-7
  lua5.3 5.3.1-1
  lua5.2 5.2.4-1
  lua5.1 5.1.5-8
You should explicitly select one to install.

E: Package 'lua' has no installation candidate

Suponho que os autores do pacote desejem que você escolha manualmente o pacote que deseja instalar.

Não há como forçar o download direto do pacote mais recente (neste caso, 5.3)?

    
por Ian Bell 18.01.2016 / 13:02

1 resposta

1

Com um hack rápido:

sudo apt-get install \
    $(sudo apt-get install -s lua | \
        awk '/^ +lua/' | \
        cut -d : -f 1 | \
        sort -Vu -k2 | \
        awk 'END {print }')

ou

package="lua"
sudo apt-get install \
    $(sudo apt-get install -s "$package" | \
        awk '/^ +'"$package"'/' | \
        cut -d : -f 1 | \
        sort -Vu -k2 | \
        awk 'END {print }')
$ sudo apt-get install \
    $(sudo apt-get install -s lua | \
        awk '/^ +lua/' | \
        cut -d : -f 1 | \
        sort -Vu -k2 | \
        awk 'END {print }')
E: Package 'lua' has no installation candidate
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  lua5.3
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 103 kB of archives.
After this operation, 379 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ wily/main lua5.3 amd64 5.3.1-1 [103 kB]
Fetched 103 kB in 0s (215 kB/s)
Selecting previously unselected package lua5.3.
(Reading database ... 419661 files and directories currently installed.)
Preparing to unpack .../lua5.3_5.3.1-1_amd64.deb ...
Unpacking lua5.3 (5.3.1-1) ...
Processing triggers for man-db (2.7.4-1) ...
Setting up lua5.3 (5.3.1-1) ...
    
por A.B. 18.01.2016 / 13:42