Durante mucho tiempo me pregunté por qué sudo apt
no se puede instalar localmente deb
desde algunas carpetas con error:
Failed to fetch a file... Permission denied
Recientemente probé sudo dpkg -i
el mismo camino y funcionó. La ruta está en el USB montado con udisks
, por lo que está dentro de una /media/user
carpeta y, a partir de ahora, supongo que se debe a ACL
esa carpeta ( drwxr-x---+
). Pero, ¿por qué a un comando sudo
se le deniega el permiso? ¿Por qué entonces otro comando en los mismos archivos funciona bien?
Lo usaría dpkg
, pero no procesa las dependencias previas en el orden adecuado, a diferencia de apt
.
¿Hay alguna forma de omitir la búsqueda de parte apt
? Antes de buscar, cerca del inicio de la salida apt
se obtiene Note selecting abc instead of abc.20-2-a.deb
. ¿Hay alguna manera de procesar archivos apt
particulares deb
, sin intentar localizar otros?
PD: Conozco otras formas de instalar debs locales, por ejemplo, agregando un repositorio local o usando archivos no preinstalados apt-offline
desdeCómo instalar paquetes sin internet, pero me gustaría mantener las cosas simples (además, sospecho que la forma del repositorio local podría enfrentar el mismo problema de permiso denegado).
Añadido 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 rd
falla, apt from ram
funciona bien, así que supongo que el problema está en mint
ACL, intenté mostrarlo a continuación, no entiendo mucho ACL en Linux. Las unidades USB insertadas están montadas debajo del usuario mint
(usuario de liveUSB), así que quiero abordarlo. Cuando obtengo el símbolo del sistema raíz , sudo -i
puedo crear manualmente mkdir
un archivo, mv
entonces , ¿por qué falla?rd
sudo touch /media/mint/rd/mpv/1
sudo apt
Agregado:
permisos inc. LCA:
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-
apto/apt-obtener salida:
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
Respuesta1
Según tengo entendido ahora (gracias a los comentarios) sudo apt
usa _apt
usuario. Y la ausencia de permiso de ejecución para la carpeta principal /media/mint
le impidió acceder a los archivos. La solución es agregar permiso ejecutivo, por ejemplo
setfacl -m u:_apt:x /media/mint