sudo apt install /path/*.deb は権限拒否を生成しますが、sudo dpkg -i /path/*.deb が正しく動作するのはなぜですか?

sudo apt install /path/*.deb は権限拒否を生成しますが、sudo dpkg -i /path/*.deb が正しく動作するのはなぜですか?

sudo apt特定のフォルダからローカルにインストールできず、debエラーが発生する理由が長い間疑問に思いました。

Failed to fetch a file... Permission denied 

最近、私はsudo dpkg -i同じ道を試して成功しました。パスはマウントされたUSBにとってフォルダ内にudisksあるのですが、これまではフォルダ( )の/media/userためだと推測しています。しかし、なぜコマンドが拒否されますか?同じファイル内の他のコマンドが正しく機能するのはなぜですか?ACLdrwxr-x---+sudo

を使用しますが、dpkg事前依存関係を正しい順序で処理しませんapt

インポート部分をスキップする方法はありますかapt?出力はインポート前に最初にapt提供されます。別のファイルを見つけるのではなく、特定のファイルをNote selecting abc instead of abc.20-2-a.deb処理する方法はありますか?aptdeb

apt-offlinePSローカルリポジトリの追加やプリインストールされていないリポジトリの使用など、ローカルデブをインストールする他の方法を知っています。インターネットなしでパッケージをインストールする方法しかし、私は物事を単純に維持したいと思いました(そしてローカルのストレージ方式も同じ権限拒否の問題に直面できると思います)。

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失敗し、apt fromはうまくram機能するため、ACLに問題があるようですmint。私は以下に表示しようとしましたが、LinuxのACLについてはわかりません。挿入されたUSBドライブがmintユーザー(liveUSBユーザー)としてインストールされているため、この問題を解決したいと思います。sudo -irootコマンドプロンプトが表示されたら、手動でファイルを生成できますが、なぜmkdir失敗するのですか?mvrdsudo touch /media/mint/rd/mpv/1sudo apt

次に追加:

権限会社のアクセス制御リスト:

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-

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

ベストアンサー1

sudo aptユーザーを使用して今理解したところ(コメントありがとうございます)、親フォルダに_apt実行権限がないため、/media/mintファイルにアクセスできません。解決策は、次の実行権限を追加することです。

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

おすすめ記事