apt install предупреждает, что .dpkg.cfg для чтения: В доступе отказано

Моя настройка следующая: мой пользователь вошел в систему через сетевую аутентификацию, его дом смонтирован по NFS (все это в Ubuntu 16.04).

Я пытаюсь настроить свой компьютер, поэтому выполнение нескольких команд apt, таких как update или install:

  • update, не выполняется с E: Unable to change to /home/$user/ - chdir (13: Permission denied). Мне удалось быстро исправить это с этим ответом , в основном cd /

  • install предупреждает меня, что: dpkg: warning: failed to open configuration file '/home/zr258722/.dpkg.cfg' for reading: Permission denied.

Как мне избавиться от этих ошибок / предупреждений?


РЕДАКТИРОВАТЬ

Точные команды, которые я выполняю, и их выходные данные:

  • sudo apt-get update, который дает:
Ign:1 http://$intranet/depots/infogerance/ubuntu/drf-i2bm_pilote xenial-security InRelease
Ign:2 http://$intranet/depots/infogerance/ubuntu/drf-i2bm_pilote xenial-updates InRelease
Ign:3 http://$intranet/depots/infogerance/ubuntu/drf-i2bm_pilote xenial InRelease
Ign:4 http://$intranet/depots/infogerance/ubuntu/saclay_pilote xenial-security InRelease
Ign:5 http://$intranet/depots/infogerance/ubuntu/saclay_pilote xenial-updates InRelease
Ign:6 http://$intranet/depots/infogerance/ubuntu/saclay_pilote xenial InRelease
Ign:7 http://$intranet/depots/neurodebian/current data InRelease            
Ign:8 http://$intranet/depots/neurodebian/current xenial InRelease                                                             
Ign:9 http://$intranet/depots/ubuntu/current xenial-security InRelease                                                         
Ign:10 http://$intranet/depots/ubuntu/current xenial-updates InRelease                                                         
Ign:11 http://dl.google.com/linux/chrome/deb stable InRelease                                                                           
Ign:12 http://$intranet/depots/ubuntu/current xenial InRelease                                                                 
Hit:13 http://$intranet/depots/infogerance/ubuntu/drf-i2bm_pilote xenial-security Release                
Hit:14 http://$intranet/depots/infogerance/ubuntu/drf-i2bm_pilote xenial-updates Release                                       
Hit:15 http://$intranet/depots/infogerance/ubuntu/drf-i2bm_pilote xenial Release                                               
Hit:16 http://$intranet/depots/infogerance/ubuntu/saclay_pilote xenial-security Release                                        
Hit:17 http://$intranet/depots/infogerance/ubuntu/saclay_pilote xenial-updates Release                                         
Hit:18 http://$intranet/depots/infogerance/ubuntu/saclay_pilote xenial Release                                                 
Hit:19 http://$intranet/depots/neurodebian/current data Release                                                                
Hit:20 http://$intranet/depots/neurodebian/current xenial Release                                                              
Hit:21 http://$intranet/depots/ubuntu/current xenial-security Release                                                          
Hit:22 http://$intranet/depots/ubuntu/current xenial-updates Release                                                           
Hit:23 http://$intranet/depots/ubuntu/current xenial Release                                                                
Hit:24 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease                                   
Hit:25 http://dl.google.com/linux/chrome/deb stable Release                                                    
Hit:26 http://ppa.launchpad.net/webupd8team/atom/ubuntu xenial InRelease
Hit:28 http://repository.spotify.com stable InRelease                   
Reading package lists... Done                     
E: Unable to change to /home/$user/ - chdir (13: Permission denied)


  • например sudo apt-get python3.6, который дает:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpython3-dev libpython3.5-dev libpython3.6 libpython3.6-dev python3.5-dev
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  python3.6-venv python3.6-doc
The following NEW packages will be installed:
  python3.6
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/246 kB of archives.
After this operation, 336 kB of additional disk space will be used.
dpkg: warning: failed to open configuration file '/home/$user/.dpkg.cfg' for reading: Permission denied
Selecting previously unselected package python3.6.
(Reading database ... 375863 files and directories currently installed.)
Preparing to unpack .../python3.6_3.6.8-1~16.04.york1_amd64.deb ...
Unpacking python3.6 (3.6.8-1~16.04.york1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
dpkg: warning: failed to open configuration file '/home/$user/.dpkg.cfg' for reading: Permission denied
Setting up python3.6 (3.6.8-1~16.04.york1) ...
dpkg: warning: failed to open configuration file '/home/$user/.dpkg.cfg' for reading: Permission denied
dpkg: warning: failed to open configuration file '/home/$user/.dpkg.cfg' for reading: Permission denied
1
задан 20 May 2019 в 17:44

3 ответа

Иногда установка происходит таким образом, что выглядит не пользователь, а программа, запрашивающая разрешение. Вы можете попытаться изменить права доступа к папке-нарушителю на

chmod 777 Offnding_foldername [ 111]

это даст всем пользователям возможность читать, писать и выполнять. Если это решит проблему, вы, возможно, посмотрите глубже и решите проблему по соображениям сетевой безопасности.

0
ответ дан 20 May 2019 в 17:44

Ваша домашняя папка должна иметь как минимум следующие разрешения: u = rwx, g = r, o = r , запустить chmod 0711 / home / $ user

1
ответ дан 5 March 2020 в 13:00

Обычно root не имеет разрешений на доступ к монтированию NFS, если только для экспорта не установлено значение no_root_squash, apt-get запускается в корневом контексте с помощью sudo и не может получить доступ к домашнему каталогу. Это раздражающее, но безобидное предупреждение, которое можно игнорировать.

1
ответ дан 31 August 2020 в 07:37

Другие вопросы по тегам:

Похожие вопросы: