Não consigo fazer o comando 'cp' funcionar

1

No terminal, quando eu emito o comando cp , ele afirma:

The program 'cp' is currently not installed. You can install it by typing:
apt-get install coreutils

Mas quando tento instalá-lo, recebo os erros listados abaixo:

depmod: FATAL: could not load /boot/System.map-3.19.0-25-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.0-25-generic /boot/vmlinuz-3.19.0-25-generic
update-initramfs: Generating /boot/initrd.img-3.19.0-25-generic
grep: /boot/config-3.19.0-25-generic: No such file or directory
WARNING: missing /lib/modules/3.19.0-25-generic
Device driver support needs thus be built-in linux image!
depmod: ERROR: could not open directory /lib/modules/3.19.0-25-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
/usr/sbin/mkinitramfs: 245: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 255: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 269: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 149: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 149: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 149: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 149: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 294: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 149: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/sbin/mkinitramfs: 173: /usr/sbin/mkinitramfs: cp: not found
/usr/share/initramfs-tools/hooks/fixrtc: 149: /usr/share/initramfs-tools/hooks/fixrtc: cp: not found
E: /usr/share/initramfs-tools/hooks/fixrtc failed with return 127.
update-initramfs: failed for /boot/initrd.img-3.19.0-25-generic with 127.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 127
dpkg: error processing package linux-image-extra-3.19.0-25-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-3.19.0-25-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Saída de echo $PATH :

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    
por Logan Herald 09.02.2016 / 15:03

1 resposta

1

Isso só mostra que você ou outra pessoa (maliciosamente) adulterou a máquina, excluindo o comando cp (ou até mesmo todo o pacote coreutils). Isso não acontece com o uso normal.

O que fazer quando cp está faltando

  1. Crie um pendrive ao vivo (você terá que usar outra máquina para fazer isso)
  2. Inicialize a partir desse pen drive
  3. Faça backup de seus dados em uma unidade externa
  4. Monte sua partição raiz, por exemplo,:% sudo mount /dev/sda2 /mnt (/ dev / sda2 é apenas um exemplo, aqui)
  5. Copie o comando cp do sistema ao vivo para sua partição raiz e reinicie o sudo cp /bin/cp /mnt/bin/cp e sudo umount /mnt && sudo shutdown -r now

Quando você estiver conectado novamente, instale ou reinstale o coreutils para ter certeza de que tudo está em ordem.

    
por mniess 17.02.2016 / 14:08