2

Since some time, whenever I call sudo apt-get update or use similar apt-get options, I get /usr/bin/test: Permission denied. An example:

username:~$ sudo apt-get update
Ign:2 http://...                 
<...>          
Hit:19 http://ppa.launchpad.net/teejee2008/ppa/ubuntu bionic InRelease         
Fetched 86,0 kB in 2s (42,2 kB/s)
sh: 1: /usr/bin/test: Permission denied
sh: 1: /usr/bin/test: Permission denied
sh: 1: /usr/bin/test: Permission denied
Reading package lists... Done

apt-get still does its job and everything works fine. Still, the denied permissions do not seem to be regular behaviour and I would like to fix them.

Does anyone know how to solve or approach this problem?

Edit:

After deleting the file /usr/bin/test (which was an empty file), I get /usr/bin/test: not found

username:~$ sudo apt-get update 
Hit:1 http://...
<...>
Get:23 http://security.ubuntu.com/ubuntu bionic-security/universe Translation-en [61,3 kB]
Fetched 362 kB in 2s (166 kB/s)                                                
sh: 1: /usr/bin/test: not found
sh: 1: /usr/bin/test: not found
sh: 1: /usr/bin/test: not found
Reading package lists... Done

It seems like some command is accessing the file. Does anyone have an idea how to debug this?

2

1 Answer 1

2

As you deleted the file we cannot diagnose the problem now.

Please get the file that you deleted back by reinstalling the package that contains it:

sudo apt install --reinstall coreutils

If the original issue was caused by wrong permissions on /usr/bin/test this command will solve your problem as well.

1
  • Thanks again. For completeness: the original file usr/bin/test was an empty file.
    – physicsGuy
    Commented Dec 15, 2018 at 22:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .