10

rename worked fine before the upgrade, now running rename in a terminal shows the following:

The program 'rename' can be found in the following packages:
 * perl
 * rename

Any (simple) suggestions please? I run this in a terminal so I can rename many files, since a GUI would be fine for just renaming a few.

  • 4
    The perl package in 17.10 no longer contains the rename script, at least not the perl version that comes with a fresh installed system. – sudodus Nov 4 '17 at 18:32
14

Click on Activities, search for "Software & Updates" and launch it. Then check the "Community-maintained free and open-source software (universe)" option if it's unchecked.

Then open Terminal and run

sudo apt update
sudo apt install rename

to install rename.

  • Brilliant! Thanks. That did the trick. It's back to normal. – Ziggy Zurynski Nov 4 '17 at 11:18
5

Quick answer and explanation of the problem

The perl package in 17.10 no longer contains the rename script, at least not the perl version that comes with a fresh installed system.

So I recommend @pomsky's answer.

sudo apt update
sudo apt install rename

Inspection in an old system (16.04.LTS)

I have the perl rename in my 16.04 LTS system, which is my production system.

$ rename
Usage: rename [-v] [-n] [-f] perlexpr [filenames]

$ which rename
/usr/bin/rename

$ l /usr/bin/rename
lrwxrwxrwx 1 root root 24 feb 28  2016 /usr/bin/rename -> /etc/alternatives/rename

$ l /etc/alternatives/rename
lrwxrwxrwx 1 root root 16 feb 28  2016 /etc/alternatives/rename -> /usr/bin/prename

$ l /usr/bin/prename
-rwxr-xr-x 1 root root 2987 mar 13  2016 /usr/bin/prename

$ head /usr/bin/prename
#!/usr/bin/perl -w
#
#  This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
#  from Larry Wall's original script eg/rename from the perl source.
#
#  This script is free software; you can redistribute it and/or modify it
#  under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
#  RCSfile: rename,v   Revision: 4.1   Date: 92/08/07 17:20:30 

If that version is what you want, you can install it with

sudo apt update
sudo apt install perl

I am not sure what you get if you install rename. Maybe the same version, maybe some other version. They might work in the same way (seen from the user interface).

Edit (correction and sorry for the confusion)

Inspection in Ubuntu 17.10

@pipe discovered a major problem, that I did not find because I checked in 16.04 LTS and relied on the information in the question (that rename is found in two packages, perl and rename). I tested and the perl package in 17.10 no longer contains the rename script, at least not the perl version that comes with a fresh installed system.

So I recommend @pomsky's answer.

sudo apt update
sudo apt install rename

which installs another perl script, as can be seen below:

tester@tester-desktop:~$ which rename
/usr/bin/rename

tester@tester-desktop:~$ l /usr/bin/rename
lrwxrwxrwx 1 root root 24 nov  4 19:08 /usr/bin/rename -> /etc/alternatives/rename

tester@tester-desktop:~$ l /etc/alternatives/rename
lrwxrwxrwx 1 root root 20 nov  4 19:08 /etc/alternatives/rename -> /usr/bin/file-rename

tester@tester-desktop:~$ l /usr/bin/file-rename
-rwxr-xr-x 1 root root 3085 sep  5 23:49 /usr/bin/file-rename

tester@tester-desktop:~$ head /usr/bin/file-rename
#!/usr/bin/perl -w
# $Revision: 331 $$Date: 2013-04-30 21:23:41 +0100 (Tue, 30 Apr 2013) $
# Robin's RCS header:
# RCSfile: rename.PL,v Revision: 1.3   Date: 2006/05/25 09:20:32 
# Larry's RCS header:
#  RCSfile: rename,v   Revision: 4.1   Date: 92/08/07 17:20:30 
#
#  Log: rename,v 
# Revision 1.5  1998/12/18 16:16:31  rmb1
# moved to perl/source

This is also a perl script, but another one compared to the one in 16.04 LTS.

  • 2
    Have you tried this solution for the Ubuntu version that the OP asks about? I have a feeling you will find that this solution will not work. – pipe Nov 4 '17 at 17:57
  • @pipe, Which solution (Do you mean using the perl package)? I have a test system with 17.10, and I can try it there within a few minutes :-) – sudodus Nov 4 '17 at 17:59
  • @pipe, You are right. I will add some information to my answer, and maybe later remove my answer, because it is no longer relevant. The perl package in 17.10 no longer contains the rename script, at least not the perl version that comes with a fresh installed system. – sudodus Nov 4 '17 at 18:17
  • Good, then it's not just me and OP having this problem. :) – pipe Nov 4 '17 at 18:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.