DEV Community

Mayank Tamrkar
Mayank Tamrkar

Posted on

How to download application in ubantu/linux using command line

๐Ÿ“Œ How to Install Applications in Ubuntu Using Commands

Ubuntu provides multiple ways to install applications using the terminal. In this blog, we will cover two efficient methods:

  1. Using Snap Package Manager (Recommended for most users)
  2. Using AppImage with WLGI (For portable applications)

๐Ÿš€ 1. Installing Applications via Snap Package Manager

โœ… What is Snap?

Snap is a universal package manager developed by Canonical that allows you to install software across different Linux distributions. It ensures applications are always updated and sandboxed for security.

๐Ÿ”น Installing Snap (If Not Installed)

Ubuntu comes with Snap pre-installed. If not, install it using:

sudo apt update
sudo apt install snapd -y
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Enable Snap Service

After installation, enable the Snap daemon:

sudo systemctl enable --now snapd.socket
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Install an Application Using Snap

To install an app, use:

sudo snap install <app-name>
Enter fullscreen mode Exit fullscreen mode

For example, to install VS Code:

sudo snap install code --classic
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Launching the Installed Application

Once installed, open the application by running:

<app-name>
Enter fullscreen mode Exit fullscreen mode

For example:

code
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Creating a Desktop Shortcut for Snap Apps

Snap applications automatically create shortcuts, but if missing:

  1. Open terminal and create a .desktop file:
   nano ~/.local/share/applications/code.desktop
Enter fullscreen mode Exit fullscreen mode
  1. Add the following content:
   [Desktop Entry]
   Name=Visual Studio Code
   Exec=/snap/bin/code
   Icon=/snap/code/current/meta/gui/code.png
   Terminal=false
   Type=Application
   Categories=Development;
Enter fullscreen mode Exit fullscreen mode
  1. Save and close (CTRL + X, Y, ENTER).
  2. Make it executable:
   chmod +x ~/.local/share/applications/code.desktop
Enter fullscreen mode Exit fullscreen mode
  1. Find the app in your application menu! ๐ŸŽ‰

๐Ÿ”ฅ 2. Installing Applications Using AppImage with WLGI

โœ… What is AppImage?

AppImage is a portable package format that allows running applications without installation. To integrate them with the desktop environment, we use WLGI (AppImage Launcher).

๐Ÿ”น Downloading an AppImage

You can download AppImage files from the official website of the application.
For example, to download Cursor (AI-Powered Code Editor):

wget -O ~/Downloads/cursor.AppImage "https://download.cursor.sh/latest-linux"
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Making the AppImage Executable

Navigate to the directory where the AppImage is downloaded and run:

chmod +x ~/Downloads/cursor.AppImage
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Running the AppImage

Execute the application by running:

~/Downloads/cursor.AppImage
Enter fullscreen mode Exit fullscreen mode

๐Ÿ”น Setting Up a Desktop Shortcut for AppImage (Using WLGI)

To make AppImages feel like installed applications, install WLGI (AppImage Launcher):

sudo add-apt-repository ppa:appimagelauncher-team/stable -y
sudo apt update
sudo apt install appimagelauncher -y
Enter fullscreen mode Exit fullscreen mode

Once installed, follow these steps:

  1. Move the AppImage to Applications Folder
   mv ~/Downloads/cursor.AppImage ~/Applications/
Enter fullscreen mode Exit fullscreen mode
  1. Launch it via AppImage Launcher (This integrates it with your system.)
   appimagelauncher integrate ~/Applications/cursor.AppImage
Enter fullscreen mode Exit fullscreen mode
  1. Now, Cursor Editor will appear in the application menu!

๐Ÿ”น Manually Creating a Desktop Shortcut for AppImage

If the app doesnโ€™t show up in your menu, create a .desktop file manually:

  1. Open terminal and create a shortcut file:
   nano ~/.local/share/applications/cursor.desktop
Enter fullscreen mode Exit fullscreen mode
  1. Add the following content:
   [Desktop Entry]
   Name=Cursor Editor
   Exec=/home/$USER/Applications/cursor.AppImage
   Icon=/home/$USER/Applications/cursor.png
   Terminal=false
   Type=Application
   Categories=Development;
Enter fullscreen mode Exit fullscreen mode
  1. Save and exit (CTRL + X, Y, ENTER).
  2. Make it executable:
   chmod +x ~/.local/share/applications/cursor.desktop
Enter fullscreen mode Exit fullscreen mode
  1. You should now see Cursor Editor in the application menu. ๐ŸŽ‰

Enjoy your Ubuntu experience with easy app installations! ๐Ÿš€

Top comments (0)