Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active distribution is not set properly with "ballerina dist pull" in Ubuntu #50

Closed
lochana-chathura opened this issue Dec 7, 2020 · 2 comments · Fixed by #55
Closed
Assignees

Comments

@lochana-chathura
Copy link
Member

Description:

  • ballerina dist pull does not set the active distribution properly in Ubuntu. Please refer to the below screenshot.
  • Had to use sudo ballerina run test.bal or set the distribution manually with ballerina dist use slp7 and then run with ballerina run test.bal

Screenshot

OS, DB, other environment details and versions:

Ubuntu 20.04
Kernel: 5.4.0-56-generic

Similar Issues:
#15

@suganyasuven
Copy link
Contributor

Since Ubuntu 19.10, sudo command does the same as sudo -H does for previous versions (https://askubuntu.com/questions/1186999/how-does-sudo-handle-home-differently-since-19-10).

As we are storing the version file inside the user home, when we use sudo location changes. Thatswhy we are getting different outputs for ballerina -v andballerina dist list.

When we issue without sudo user.home will be /home/suganya/.ballerina/ballerina-version
with sudo /root/.ballerina/ballerina-version

@suganyasuven
Copy link
Contributor

In Ubuntu-16.04, ballerina -v shows the correct version without sudo.

suganya@suganya-VirtualBox:~$ sudo ballerina dist pull slp5
[sudo] password for suganya:
Fetching the 'slp5' distribution from the remote server...
Downloading slp5 100% [======================] 297/297 MB (0:01:58 / 0:00:00)

Fetching the dependencies for 'slp5' from the remote server...
Dependency 'jdk-11.0.8+10-jre' is already available locally
'slp5' successfully set as the active distribution
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$ ballerina -v
Ballerina Swan Lake Preview 5
Language specification v2020-09-22
Update Tool 0.8.10
suganya@suganya-VirtualBox:~$

However, in Ubuntu-20.10, we have to use sudo to get the correct version.

suganya@suganya-VirtualBox:~$ sudo ballerina dist pull jballerina-1.2.3
Fetching the 'jballerina-1.2.3' distribution from the remote server...
Downloading jballerina-1.2.3 100% [==========] 104/104 MB (0:00:43 / 0:00:00)
'jballerina-1.2.3' successfully set as the active distribution
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$
suganya@suganya-VirtualBox:~$ ballerina -v
jBallerina 1.1.0
Language specification 2019R3
Ballerina tool 0.8.0
suganya@suganya-VirtualBox:~$ sudo ballerina -v
jBallerina 1.2.3
Language specification 2020R1
Ballerina tool 0.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants