TransWikia.com

Why are directory permissions preventing "sudo apt install" using a file?

Unix & Linux Asked by Haydon on December 17, 2021

I have found that using

sudo apt install ./<package_name_here>.deb

fails with

E: Failed to fetch file:<path_to_package>/<package_name_here>.deb File not found - <path_to_package>/<package_name_here>.deb (13: Permission denied)

when a containing directory of ./<package_name_here>.deb has permissions set to 700.

However, there is no issue when using

sudo dpkg -i ./<package_name_here>.deb

Is this a bug of apt or am I doing something wrong?


  • lubuntu 20.04
  • apt 2.0.2 (amd64)
  • dpkg 1.19.7 (amd64)

2 Answers

Do you realize that apt and dpkg are not the same?

The /etc/apt/sources.list file is used to locate the desired packages in apt-get (as in apt).

Answered by oroverdino on December 17, 2021

Since version 1.1, apt uses an unprivileged user (_apt) to download packages. This includes local package retrieval, unless (in theory) the package isn’t world-readable; there have been bugs with this in the past (see #805069), this could be a variant...

You can disable this by setting APT::Sandbox::User to root:

apt -o APT::Sandbox::User=root ...

Answered by Stephen Kitt on December 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP