Pamac getcwd error

Any help with this?

$ pamac update -a --force-refresh
Preparing...
Synchronizing package databases...
Refreshing core.db...                                                                                                                                                                                                                       
Refreshing extra.db...                                                                                                                                                                                                                      
Refreshing community.db...                                                                                                                                                                                                                  
Refreshing multilib.db...                                                                                                                                                                                                                   
Refreshing core.files...                                                                                                                                                                                                                    
Refreshing extra.files...                                                                                                                                                                                                                   
Refreshing community.files...                                                                                                                                                                                                               
Refreshing multilib.files...                                                                                                                                                                                                                
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory                                                                                                                         
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Refreshing AUR...                                                                                                                                                                                                                           
Cloning brave-beta-bin build files...                                                                                                                                                                                                       
Generating brave-beta-bin information...
Checking brave-beta-bin dependencies...
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Resolving dependencies...
Checking inter-conflicts...

To build (1):
  brave-beta-bin  1.45.104-1  (1.45.103-1)  AUR


Edit build files : [e] 
Apply transaction ? [e/y/N] y

shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Building brave-beta-bin...
==> Making package: brave-beta-bin 1.45.104-1 (Tue 18 Oct 2022 09:10:04 PM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading brave-browser-beta_1.45.104_amd64.deb...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  100M  100  100M    0     0  6600k      0  0:00:15  0:00:15 --:--:-- 7735k
  -> Found MPL2
  -> Found brave-beta-bin.sh
==> Validating source files with sha512sums...
    brave-browser-beta_1.45.104_amd64.deb ... Passed
    MPL2 ... Passed
    brave-beta-bin.sh ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting brave-browser-beta_1.45.104_amd64.deb with bsdtar
==> Starting prepare()...
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "brave-beta-bin"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: brave-beta-bin 1.45.104-1 (Tue 18 Oct 2022 09:10:33 PM)
==> Cleaning up...

Checking keyring...                                                                                                                                                                                                                    [1/1]
Checking integrity...                                                                                                                                                                                                                  [1/1]
Loading packages files...                                                                                                                                                                                                              [1/1]
Checking file conflicts...                                                                                                                                                                                                             [1/1]
Checking available disk space...                                                                                                                                                                                                       [1/1]
Upgrading brave-beta-bin (1.45.103-1 -> 1.45.104-1)...                                                                                                                                                                                 [1/1]
Running post-transaction hooks...
Arming ConditionNeedsUpdate...                                                                                                                                                                                                         [1/2]
Updating the desktop file MIME type cache...                                                                                                                                                                                           [2/2]
rm: cannot remove '/var/tmp/pamac/dbs/sync': Is a directory
Transaction successfully finished.

Hi @Tribble,

Although not about yay, pamac, pacman, or any other package management, this page explains the cause is:

This usually occurs when your current directory does not exist anymore. Most likely, from another terminal you removed that directory .

So try changing to another directory before executing the command again:

  • To change to your home directorry:
cd ~
  • Run the command again:
pamac update -a --force-refresh

Hope this helps!

You are right, I was cd to a directory which was removed from another shell. Weird that interferes with pamac anyway…

1 Like

Weird, yes. For us uninformed ones specifically.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.