legacy-knowledge-base
公開されました Jul. 2, 2025

Command-Line Tool installation in Linux Debian

written-by

Sergio Alonso

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

username@mylaptop:~$ curl https://cdn.liferay.cloud/lcp/stable/latest/install.sh -fsSL | bash
...
...
...
Installed, type 'lcp --help' to start.
username@mylaptop:~$ lcp --help
username@mylaptop:~$
  • If lcp command is run using sudo command, it is unable to open web browser for authentication:
username@mylaptop:~/$ sudo lcp login -v
Remote infrastructure: liferay.cloud
Should get new token: false
Fetching current user...
Could not retrieve current user.
Reason: Request failed with status code 404
? Open your browser and authenticate? Yes

 

Environment

  • Linux Debian Operating System.

Resolution

  • For opening the web browser, lcp calls xdg-open command. And this command, in turn, conflicts with sudo command. This is what happens under the hood:
username@mylaptop:~/$ sudo xdg-open https://console.liferay.cloud/login-sso

Running Firefox as root in a regular user's session is not supported ($XAUTHORITY is /run/user/1000/.mutter-Xwaylandauth.ESSMP1 which is owned by username.)
username@mylaptop:~/$
  • To fix the issue, the lcp binary file must have setuid root changed:
username@mylaptop:~$ ls -l lcp
-rwsr-xr-x 1 root staff 68136679 jun 3 11:16 lcp
username@mylaptop:~$
  • Thus, it is no longer necessary to use sudo command, so you can invoke lcp command directly:
username@mylaptop:~/$ lcp login -v
Remote infrastructure: liferay.cloud
Should get new token: false
Fetching current user...
Could not retrieve current user.
Reason: Request failed with status code 404
? Open your browser and authenticate? Yes
Opening server with the following URL: https://console.liferay.cloud/login?redirect_uri=http%3A%2F%2Flocalhost%3A40169%3Fversion%3D3
✓ Authentication completed [2/2]
...
...
...
did-this-article-resolve-your-issue

legacy-knowledge-base