0
$\begingroup$

Rosanswers logo

Run

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc 

Then after

source ~/.bashrc 

Showing

bash: /otp/ros/melodic/setup.bash: No such file or directory. 

Originally posted by 1at7 on ROS Answers with karma: 3 on 2019-08-02

Post score: 0


Original comments

Comment by PeteBlackerThe3rd on 2019-08-02:\

/otp/ros...

is this a typo in your question or what you're actually seeing it should be /opt/ros.... This could be causing your problem.

If you look at the contents of your .bashrc script you can check and fix the typo if that's the case

Comment by 1at7 on 2019-08-02:
i copy pasted from http://wiki.ros.org/melodic/Installation/Ubuntu and it is like

echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc 

Comment by gvdhoorn on 2019-08-03:
Ok.

So what is the output of ls -al /opt/ros/melodic/setup.bash?

And the output of lsb_release -a?

And of uname -a?

Comment by 1at7 on 2019-08-03:
Output of 1st ls: cannot access '/opt/ros/melodic/setup.bash' : No such file or directory 2nd No LSB modules are available. And for 3rd one.. my PC name, Ubuntu version, GNU/Linux

Comment by gvdhoorn on 2019-08-03:
We need the verbatim, exact copy-paste of the uname -a output. You can change your PC name, but leave the rest.

As to the rest: it would appear that you haven't installed ROS.

Comment by 1at7 on 2019-08-03:
unaame -a output as

Linux ********* #26~18.04.1-Ubuntu SMP Thu Jun 27 07:28:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux 

Comment by 1at7 on 2019-08-03:
i even tried instaling LSB but it shows

E: Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Suite) E: The list of sources could not be read. 

Comment by gvdhoorn on 2019-08-03:
Ah, that would appear to be your problem: it's likely that apt install ros-melodic-desktop-full didn't actually succeed. Didn't you get an error?

I'm pretty sure that the fact that lsb_release doesn't work is the cause of your problems.

What is the output of cat /etc/apt/sources.list.d/ros-latest.list?

Comment by 1at7 on 2019-08-03:
it gives

deb http://packages.ros.org/ros/ubuntu (lsb_release -sc) main 

Comment by 1at7 on 2019-08-03:
output of trying install ros was w/o error when i run 1st time but it gives this now

E: Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Suite) E: The list of sources could not be read. E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root? 

Comment by gvdhoorn on 2019-08-03:\

output of trying install ros was w/o error when i run 1st time

not saying you're lying, but without ros-latest.list setup correctly, it's impossible for apt to install anything.

Comment by [email protected] on 2020-10-17:
in my case its still not working

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

it gives

deb http://packages.ros.org/ros/ubuntu (lsb_release -sc) main 

The problem most likely is that lsb_release has not been setup/installed correctly, which causes the command given in the installation tutorials to produce incorrect output, leading to a malformed ros-latest.list, which then causes apt to fail downloading indices from the ROS package repositories, leading to apt install never succeeding to install ROS.

Steps to fix:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list' sudo apt clean && sudo apt update 

Pay special attention to the output of apt update. It should not report any errors or warnings.

Now you should be able to run sudo apt install ros-melodic-desktop-full successfully, and a source /opt/ros/melodic/setup.bash should also succeed.

Note that we're avoiding the use of lsb_release -sc here by just specifying the bionic value (which is the codename of your Ubuntu distribution). If you'd like to fix lsb_release (and are sure lsb_release -sc doesn't actually output anything) you could try to do something like sudo apt install --reinstall lsb-release lsb-core and see if lsb_release -sc starts working.


Originally posted by gvdhoorn with karma: 86574 on 2019-08-03

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by 1at7 on 2019-08-03:
thank god it worked finally.. i am really noob in linux X)

Comment by gvdhoorn on 2019-08-03:
Does it now work?


i am really noob in linux

If you're planning on using ROS, it would be good to get familiar with Linux (or just Ubuntu) a bit more. It will probably help make all of this less 'magic' and complicated.

Comment by 1at7 on 2019-08-03:
ya sure. btw thanks for support and quick response. and it worked and now I have running ros core. thanks again..

$\endgroup$