Legacy Knowledge Base
Published 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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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