2

I am following this thread: How to install Eclipse?

I downloaded eclipse-jee-mars-1-linux-gtk-x86_64.tar.gz into ~/Documents and ran the tar command that extracted the package into an eclipse folder inside ~/Documents -- ~/Documents/eclipse now exists.

I don't have permission to copy this folder to /opt, so I log-in as root with su - command and password. As root, I try to execute the sudo mv eclipse /opt command but it's throwing the error: mv: cannot stat 'eclipse': No such file or directory.

It seems no one has had this problem. What's the issue here?

2 Answers2

2

When you login as su - your environment changes, you are now root and current working directory is /root

skolodya@ubuntu:$ su -                                                         
Password: 
$ pwd
/root

What you need to do is mv /home/$USER/eclipse /opt . Note: change $USER to your actual user name

Side note: When you run as root you dont need sudo. As regular user , without login in to su - you could just do sudo mv ~/Documents/eclipse /opt and that would do it, because your environment with sudo wouldn't change

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497
  • If I was allowed, I would give you the uptick. As a sidenote, I used the thread below to add my user in the sudoers file so that I could run the sudo command directly within the folder without logging in as root. http://askubuntu.com/questions/7477/how-can-i-add-a-new-user-as-sudoer-using-the-command-line – Christopher Williams Jan 22 '16 at 19:14
  • @Mr_C_Willy when you create user at installation, you already are in sudo group , you shouldn't need to do that :) – Sergiy Kolodyazhnyy Jan 22 '16 at 19:17
  • When I used sudo as my regular user and put it in my password, it told me that I did not have permission and a log was recorded. – Christopher Williams Jan 22 '16 at 19:29
  • @Mr_C_Willy Hmm, OK. Well, not you know for future to create a user during installation :) Glad i could help. Once you can, please leave an upvote if my answer was useful. Thanks – Sergiy Kolodyazhnyy Jan 22 '16 at 19:46
0

Serg gave the right answer but I'd just like to add that Eclipse is available in the Ubuntu software centre, which will allow you to get automatic updates, unlike downloading the source.

To get Eclipse installed easily, just search for it in the Software Centre (or search for eclipse-platform), or use sudo apt install eclipse*.

cat
  • 1,672