Por que sudo apt install /path/*.deb produz permissão negada enquanto sudo dpkg -i /path/*.deb funciona bem?

Por que sudo apt install /path/*.deb produz permissão negada enquanto sudo dpkg -i /path/*.deb funciona bem?

Fiquei me perguntando há muito tempo por que sudo aptnão consigo instalar o local debde algumas pastas com erro:

Failed to fetch a file... Permission denied 

Recentemente tentei sudo dpkg -io mesmo caminho e funcionou. O caminho está montado em USB com udisks, então está dentro de uma /media/userpasta e a partir de agora meu palpite é que está ACLnessa pasta ( drwxr-x---+). Mas por que um comando sudotem permissão negada? Por que então outro comando nos mesmos arquivos funciona bem?

Eu usaria dpkg, mas ele não processa pré-dependências na ordem adequada, ao contrário de apt.

Existe alguma maneira de pular a busca da parte apt? Antes da busca, próximo ao início da saída aptfornece Note selecting abc instead of abc.20-2-a.deb. Existe uma maneira de processar arquivos aptespecíficos deb, e não tentar localizar outros?

PS: Estou ciente de outras maneiras de instalar debs locais, por exemplo, adicionando repositório local ou usando não pré-instalado apt-offlinedeComo instalar pacotes sem internet, mas gostaria de manter as coisas simples (além disso, suspeito que o repositório local possa enfrentar o mesmo problema de permissão negada).

Adicionado 2:

sudo mount rd -t tmpfs /media/mint/rd -o x-mount.mkdir
sudo mount ram -t tmpfs /media/ram -o x-mount.mkdir

apt from rdfalha, apt from ramfunciona bem, então acho que o problema está no mintACL, tentei mostrar abaixo, não entendo muito de ACL no Linux. As unidades USB inseridas são montadas no usuário mint(usuário liveUSB), então quero resolver isso. Quando eu sudo -iobtenho o prompt de comando root, posso criar manualmente um arquivo mkdir, então por que falha?mvrdsudo touch /media/mint/rd/mpv/1sudo apt

Adicionado:

permissões inc. ACL:

mint@mint:~$ ls -la /media/mint/rd
total 0
drwxrwxrwt  4 root root 80 Oct 24 03:23 .
drwxr-xrw-+ 4 root root 80 Oct 24 03:22 ..
drwxrwxrwx  2 mint mint 80 Oct 12 23:01 ffmpeg
drwxrwxrwx  2 mint mint 60 Oct 11 17:53 mpv

ACL:
mint@mint:~$ getfacl /media/mint/
getfacl: Removing leading '/' from absolute path names
# file: media/mint/
# owner: root
# group: root
user::rwx
user:mint:r-x
group::---
mask::r-x
other::rw-

Saída apt/apt-get:

mint@mint:~$ sudo apt install -d /media/mint/rd/ffmpeg/*.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'ffmpeg' instead of '/media/mint/rd/ffmpeg/ffmpeg_7%3a4.2.4-1ubuntu0.1_amd64.deb'
Note, selecting 'libavresample4' instead of '/media/mint/rd/ffmpeg/libavresample4_7%3a4.2.4-1ubuntu0.1_amd64.deb'
Suggested packages:
  ffmpeg-doc
The following NEW packages will be installed:
  ffmpeg libavresample4
0 upgraded, 2 newly installed, 0 to remove and 71 not upgraded.
Need to get 1507 kB of archives.
After this operation, 2275 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1
Ign:2 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1
Ign:1 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1
Ign:2 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1
Get:1 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1 [54.2 kB]
Err:1 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1
  File not found - /media/mint/rd/ffmpeg/libavresample4_70x0.07ffe00000006p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
Get:2 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1 [1453 kB]
Err:2 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1
  File not found - /media/mint/rd/ffmpeg/ffmpeg_70x0.07ffe00000002p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
E: Failed to fetch file:/media/mint/rd/ffmpeg/libavresample4_7%3a4.2.4-1ubuntu0.1_amd64.deb  File not found - /media/mint/rd/ffmpeg/libavresample4_70x0.07ffe00000006p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
E: Failed to fetch file:/media/mint/rd/ffmpeg/ffmpeg_7%3a4.2.4-1ubuntu0.1_amd64.deb  File not found - /media/mint/rd/ffmpeg/ffmpeg_70x0.07ffe00000002p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
E: Some files failed to download
mint@mint:~$ sudo apt-get install -d /media/mint/rd/ffmpeg/*.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'ffmpeg' instead of '/media/mint/rd/ffmpeg/ffmpeg_7%3a4.2.4-1ubuntu0.1_amd64.deb'
Note, selecting 'libavresample4' instead of '/media/mint/rd/ffmpeg/libavresample4_7%3a4.2.4-1ubuntu0.1_amd64.deb'
Suggested packages:
  ffmpeg-doc
The following NEW packages will be installed:
  ffmpeg libavresample4
0 upgraded, 2 newly installed, 0 to remove and 71 not upgraded.
Need to get 1507 kB of archives.
After this operation, 2275 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1
Ign:2 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1
Ign:1 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1
Ign:2 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1
Get:1 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1 [54.2 kB]
Err:1 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 libavresample4 amd64 7:4.2.4-1ubuntu0.1
  File not found - /media/mint/rd/ffmpeg/libavresample4_70x0.07fff00000006p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
Get:2 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1 [1453 kB]
Err:2 http://security.ubuntu.com/ubuntu focal-updates/universe amd64 ffmpeg amd64 7:4.2.4-1ubuntu0.1
  File not found - /media/mint/rd/ffmpeg/ffmpeg_70x0.07fff00000002p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
E: Failed to fetch file:/media/mint/rd/ffmpeg/libavresample4_7%3a4.2.4-1ubuntu0.1_amd64.deb  File not found - /media/mint/rd/ffmpeg/libavresample4_70x0.07fff00000006p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
E: Failed to fetch file:/media/mint/rd/ffmpeg/ffmpeg_7%3a4.2.4-1ubuntu0.1_amd64.deb  File not found - /media/mint/rd/ffmpeg/ffmpeg_70x0.07fff00000002p-10224.2.4-1ubuntu0.1_amd64.deb (13: Permission denied)
E: Some files failed to download

Responder1

Como entendi agora (graças aos comentários) sudo aptusa _aptuser. E a ausência de permissão de execução para a pasta pai /media/mintimpediu o acesso aos arquivos. A solução alternativa é adicionar permissão exec, por exemplo

setfacl -m u:_apt:x /media/mint

informação relacionada