0

For some reason I get this error all the time in system scripts:

rm: not found

For example I wanted to update the system:

Setting up install-info (5.2.0.dfsg.1-6) ...
/usr/sbin/update-info-dir: 52: /usr/sbin/update-info-dir: rm: not found
dpkg: error processing package install-info (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

It has nothing to do with the package "Install-info". This happens with all packages. It also happens when crond is running. I think it has to do with when a system script wants to remove a file.

I can use rm both as normal user and root.
This started after upgrading to vivid.

UPDATE:
This error is not only for rm but for other commands for example date and pidof as shown from this cron log.

/etc/cron.daily/apt:
/etc/cron.daily/apt: 91: /etc/cron.daily/apt: date: not found
/etc/cron.daily/apt: 97: /etc/cron.daily/apt: rm: not found
/etc/cron.daily/apt: 448: /etc/cron.daily/apt: pidof: not found
xargs: rm: No such file or directory
/etc/cron.daily/apt: 176: /etc/cron.daily/apt: date: not found
/etc/cron.daily/apt: 176: /etc/cron.daily/apt: date: not found

UPDATE-2. Trying to reinstall coreutils and sysvinit-utils.

norty@powerplant:~$ sudo apt-get install --reinstall coreutils sysvinit-utils
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 63 not upgraded.
1 not fully installed or removed.
Need to get 1,176 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://se.archive.ubuntu.com/ubuntu/ vivid/main coreutils amd64 8.23-3ubuntu1 [1,137 kB]
Get:2 http://se.archive.ubuntu.com/ubuntu/ vivid/main sysvinit-utils amd64 2.88dsf-53.2ubuntu12 [39.1 kB]
Fetched 1,176 kB in 11s (104 kB/s)
Setting up install-info (5.2.0.dfsg.1-6) ...
/usr/sbin/update-info-dir: 52: /usr/sbin/update-info-dir: rm: not found
dpkg: error processing package install-info (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also manually downloaded the packages coreutils and sysvinit-utils. Then I installed them with the dpkg -i. The install finish without any errors but apt still gives the same error.

4
  • It has everything to do with install-info as /usr/sbin/update-info-dir is provided by install-info ..run sudo apt-get install --reinstall install-info and then check..
    – heemayl
    Sep 13, 2015 at 19:41
  • Updated my post. This error is for other commands also like date and pidof.
    – Sun_Blood
    Sep 14, 2015 at 17:17
  • how did you go about upgrading to vivid? did you use sudo do-release-upgrade?
    – mchid
    Sep 14, 2015 at 23:26
  • 1
    Yes, same way I have done for many years. Very strange this.
    – Sun_Blood
    Sep 15, 2015 at 5:02

2 Answers 2

2

Okay, most of these are from the same package coreutils and pidof is from sysvinit-utils. Hopefully, these will install.

Run the following commands:

sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall coreutils sysvinit-utils

Post any errors, there's always a way to manually install these as well.


Manual install:

cd
mkdir aptget;cd aptget
apt-get download coreutils
ar xvf *
tar xvf data*
sudo mv /bin/rm /bin/oldrm
sudo mv /bin/date /bin/olddate
sudo cp bin/rm /bin/
sudo cp bin/rm /usr/bin/
sudo cp bin/date /bin/
sudo cp bin/date /usr/bin/

Now, try to run apt-get and see if it is successful. If you don't get the "not found" error anymore, run the following commands:

sudo cp bin/* /bin/
sudo cp bin/* /usr/bin/

When you are finished, remove the temp directory:

cd ..
rm -R aptget
7
  • I updated my post. Sadly it's not only rm that is affected.
    – Sun_Blood
    Sep 14, 2015 at 17:18
  • @Sun_Blood I have updated the answer
    – mchid
    Sep 15, 2015 at 0:20
  • I also updated now. I did what you suggested and then I also manually download the packages from ubuntu and install them but it made no different to apt.
    – Sun_Blood
    Sep 15, 2015 at 5:19
  • how did you go about manually installing? dpkg?
    – mchid
    Sep 15, 2015 at 5:45
  • 1
    Perfect! Big thanks @mchid. You saved me a reinstall of the machine. After I did your suggestion I got the same error again but for 'cp'. So I did some digging around and realize that all the commands in 'coreutils' was missing from /usr/bin/ I don't know how that could have happen but after moving all commands to /usr/bin/ all my errors was gone! =)
    – Sun_Blood
    Sep 15, 2015 at 17:58
0

In my case, the problem was an empty PATH setting in /etc/environment file. It should be:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

You must log in to answer this question.

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