Showing posts with label Ubuntu Install Application. Show all posts
Showing posts with label Ubuntu Install Application. Show all posts

Sunday, December 27, 2020

Flutter - Setup - Linux Desktop Development

If you have installed flutter from snap previously. Please remove it:

1 sudo snap remove flutter


 For Linux desktop development, you need the following in addition to the Flutter SDK:

  1. Clang

  2. CMake

  3. GTK development headers

  4. Ninja build

  5. pkg-config

  6. libblkid

  7. liblzma

Step 1: Pls install these dependencies using:

1 sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev

Also, check for the existence of open jdk 8:

1 2 3 4 $ java -version openjdk version "1.8.0_275" OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~20.04-b01) OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)

If Open Jdk is not available install it using:

1 2 sudo apt-get install openjdk-8-jdk sudo update-alternatives --config java

After running “sudo update-alternatives --config java” we have to select the number which contain jdk-8.

Export the environment variable - JAVA_HOME as follows:

1 export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"

Also, add the above line as the last line in the file: ~/.bashrc


Step 2: Change directory to /usr/local:

1 cd /usr/local

Step 3: Get the Flutter repo from Github using the following command:

1 sudo git clone https://github.com/flutter/flutter.git

Step 4: Check the current user using the command:

1 2 $ whoami ubuntu

Since, Our login user is: ubuntu

Step 5: Change the ownership of the flutter repo directory to current user: ubuntu

1 sudo chown -R ubuntu:ubuntu /usr/local/flutter

Step 6: Add the following line to the file ~/.bashrc atthe end of the file

1 2 3 vi ~/.bashrc ### add below line at the end of the file export PATH="$PATH:/usr/local/flutter/bin"

Step 7: Update the Path Variable in the current terminal:

1 export PATH="$PATH:/usr/local/flutter/bin"

Step 8: Change the current branch to master and upgrade:

1 2 flutter channel master flutter upgrade -f

Step 9: Run the following command to see if there are any dependencies you need to install to complete the setup

1 flutter doctor

Step 10: Optionally, pre-download development binaries:

The flutter tool downloads platform-specific development binaries as needed. For scenarios where pre-downloading these artifacts is preferable (for example, in hermetic build environments, or with intermittent network availability), iOS and Android binaries can be downloaded ahead of time by running:

1 flutter precache

Step 11: Enable Linux Deskop

1 2 flutter config --enable-linux-desktop

Step 12: Step a directory to store flutter projects:

1 2 mkdir /opt/flutter-projects/ cd /opt/flutter-projects/

Step 13: Create our first flutter app using the command:

1 2 flutter create myapp cd /opt/flutter-projects/myapp

Step 14: Run our flutter app:

1 2 flutter create . flutter run -d linux


 References:

Thursday, March 12, 2020

Rust - Install Ubuntu Linux

To Install Rust in Ubuntu. Follow the instructions at the link:
https://www.rust-lang.org/tools/install

Step 1: Run the curl command.

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to
Cargo's bin directory, located at:

  /home/ubuntu/.cargo/bin

This can be modified with the CARGO_HOME environment variable.

Rustup metadata and toolchains will be installed into the Rustup
home directory, located at:

  /home/ubuntu/.rustup

This can be modified with the RUSTUP_HOME environment variable.

This path will then be added to your PATH environment variable by
modifying the profile file located at:

  /home/ubuntu/.profile

You can uninstall at any time with rustup self uninstall and
these changes will be reverted.

Current installation options:


   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-02-27, rust version 1.41.1 (f3e1a954d 2020-02-24)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %)  11.1 MiB/s in  1s ETA:  0s
info: downloading component 'rust-std'
 17.7 MiB /  17.7 MiB (100 %)  11.2 MiB/s in  1s ETA:  0s
info: downloading component 'rustc'
 58.0 MiB /  58.0 MiB (100 %)  11.2 MiB/s in  5s ETA:  0s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
 12.0 MiB /  12.0 MiB (100 %)   8.5 MiB/s in  1s ETA:  0s
info: installing component 'rust-std'
info: installing component 'rustc'
 58.0 MiB /  58.0 MiB (100 %)  13.4 MiB/s in  4s ETA:  0s
info: installing component 'rustfmt'
info: default toolchain set to 'stable'

  stable installed - rustc 1.41.1 (f3e1a954d 2020-02-24)


Rust is installed now. Great!

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH
environment variable. Next time you log in this will be done
automatically.

To configure your current shell run source $HOME/.cargo/env
$

Step 2: Check for Rust:
$ which rustc

Step 3: Since, it resulted in no output. That means Rust compiler is notavailable

Step 4: On running the source command the rust compiler is available.

$ source $HOME/.cargo/env
$ which rustc
/home/mhc/.cargo/bin/rustc

Tuesday, September 24, 2019

JavaScript - Uninstall and re-Install nodejs and npm in Ubuntu 18.04

Since, I wanted to uninstall and re-install the latest stable version of nodejs. 

Step 1: Remove all node versions and nvm

# Remove nvm
sudo rm -rf ~/.nvm
hash -r

# Remove latest node version
sudo npm uninstall -g n

# Remove n
cd ~/src/n && sudo make uninstall && cd .. && sudo rm -r n

# Remove latest nodejs version
sudo apt-get purge -y nodejs npm

# Remove nodejs-legacy version
sudo apt-get purge -y nodejs-legacy npm

sudo apt -y autoremove

# Remove nodejs files
sudo rm -rf /usr/local/lib/node_modules/npm
sudo rm -rf /usr/local/lib/node_modules/n
sudo rm -f /usr/local/bin/node
sudo rm -f /usr/local/bin/npm
sudo rm -f /usr/bin/node
sudo rm -rf /usr/local/n/versions/node


Let us install using NVM. (Node Version Manager)

Step 2: Download the shell script to install nvm:
$ curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh -o install_nvm.sh

Step 3: Install NVM - using shell script:
$ bash install_nvm.sh
You have $NVM_DIR set to "/home/ubuntu/.nvm", but that directory does not exist. Check your profile files and environment.

Since, it couldn't find the .nvm directory as it got removed during the uninstallation process. Hence, we will manually re-create it.

Step 4: Make directory .nvm: 
$ mkdir .nvm

Hence, Rerunning command in Step 3: 
$ bash install_nvm.sh
=> Downloading nvm from git to '/home/ubuntu/.nvm'
=> Cloning into '/home/ubuntu/.nvm'...
remote: Enumerating objects: 267, done.
remote: Counting objects: 100% (267/267), done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 267 (delta 31), reused 80 (delta 15), pack-reused 0
Receiving objects: 100% (267/267), 119.47 KiB | 344.00 KiB/s, done.
Resolving deltas: 100% (31/31), done.
=> Compressing and cleaning up git repository

=> nvm source string already in /home/ubuntu/.bashrc
=> bash_completion source string already in /home/ubuntu/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
$

Step5 : List down the LTS releases:

$ nvm ls-remote | grep "Latest LTS"
         v4.9.1   (Latest LTS: Argon)
        v6.17.1   (Latest LTS: Boron)
        v8.16.1   (Latest LTS: Carbon)
->     v10.16.3   (Latest LTS: Dubnium)


Step 6: Now let us install Node.js:

$ nvm install 10.16.3
Downloading and installing node v10.16.3...
Downloading https://nodejs.org/dist/v10.16.3/node-v10.16.3-linux-x64.tar.xz...
####################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v10.16.3 (npm v6.9.0)
Creating default alias: default -> 10.16.3 (-> v10.16.3)

Step 7: Check the Node and NPM Versions:

$ node --version
v10.16.3

$ npm --version
6.9.0



References:


Tuesday, August 27, 2019

Docker Compose - Install in Ubuntu

To install Docker, please refer to the previous blogpost:
https://sashankexpresstech.blogspot.com/2019/08/docker-install-on-ubuntu.html

Installing Docker Compose in Ubuntu Linux:


Step 1: Download Docker Compose from GitHub repository:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Step 2:  Provide the execute permission:
sudo chmod +x /usr/local/bin/docker-compose

Step 3: Create a shortcut:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose


Check the Installation:

$ docker-compose -version
docker-compose version 1.24.1, build 4667896b



Tuesday, August 20, 2019

Docker - Install on Ubuntu


Repositories of Docker for Ubuntu Bionic are available at:
https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/


In order to install docker community edition on Ubuntu Bionic - I used the following steps:

  • wget -c https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/containerd.io_1.2.6-3_amd64.deb
  • wget -c https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce-cli_19.03.1~3-0~ubuntu-bionic_amd64.deb
  • wget -c https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64/docker-ce_19.03.1~3-0~ubuntu-bionic_amd64.deb





  • sudo dpkg -i containerd.io_1.2.6-3_amd64.deb
  • sudo dpkg -i docker-ce-cli_19.03.1~3-0~ubuntu-bionic_amd64.deb
  • sudo dpkg -i docker-ce_19.03.1~3-0~ubuntu-bionic_amd64.deb




References:
https://docs.docker.com/install/linux/docker-ce/ubuntu/

Monday, February 25, 2019

Ubuntu - Installing fonts quickly



To be able to install fonts in ubuntu quickly, I found the following link useful:
https://askubuntu.com/questions/191778/how-to-install-many-font-files-quickly-and-easily


Step 1: Create the path in home directory:
$ mkdir ~/.fonts

Step 2: Place the fonts in this folder:

~/.fonts$ ls -l
total 2096
drwxr-xr-x 2 ubuntu ubuntu    4096 Feb 25 11:02 league-spartan
-rw-rw-r-- 1 ubuntu ubuntu   21379 Feb 25 10:59 league-spartan.zip
drwxrwxr-x 2 ubuntu ubuntu    4096 Nov 29 13:15 Montserrat
-rw-rw-r-- 1 ubuntu ubuntu 2104101 Feb 25 10:59 Montserrat.zip
~/.fonts$ 

Step 3: Install the fonts using the command:

~/.fonts/Montserrat$ fc-cache -f -v
/usr/share/fonts: caching, new cache contents: 0 fonts, 6 dirs
/usr/share/fonts/X11: caching, new cache contents: 0 fonts, 4 dirs
/usr/share/fonts/X11/Type1: caching, new cache contents: 8 fonts, 0 dirs
/usr/share/fonts/X11/encodings: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/X11/encodings/large: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/X11/misc: caching, new cache contents: 89 fonts, 0 dirs
/usr/share/fonts/X11/util: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cMap: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cmap: caching, new cache contents: 0 fonts, 5 dirs
/usr/share/fonts/cmap/adobe-cns1: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cmap/adobe-gb1: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cmap/adobe-japan1: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cmap/adobe-japan2: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/cmap/adobe-korea1: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/opentype: caching, new cache contents: 0 fonts, 2 dirs
/usr/share/fonts/opentype/malayalam: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/fonts/opentype/noto: caching, new cache contents: 24 fonts, 0 dirs
/usr/share/fonts/truetype: caching, new cache contents: 0 fonts, 46 dirs
/usr/share/fonts/truetype/Gargi: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/Gubbi: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/Nakula: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/tibetan-machine: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/truetype/tlwg: caching, new cache contents: 58 fonts, 0 dirs
/usr/share/fonts/truetype/ttf-khmeros-core: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/truetype/ubuntu: caching, new cache contents: 13 fonts, 0 dirs
/usr/share/fonts/type1: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/type1/gsfonts: caching, new cache contents: 35 fonts, 0 dirs
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/home/mhc/.local/share/fonts: caching, new cache contents: 1 fonts, 0 dirs
/home/mhc/.fonts: caching, new cache contents: 0 fonts, 2 dirs
/home/mhc/.fonts/Montserrat: caching, new cache contents: 18 fonts, 0 dirs
/home/mhc/.fonts/league-spartan: caching, new cache contents: 1 fonts, 0 dirs
/var/cache/fontconfig: not cleaning unwritable cache directory
/home/mhc/.cache/fontconfig: cleaning cache directory
/home/mhc/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded
~/.fonts/Montserrat$

We can verify that the fonts are installed by opening LibreOffice writer and typing the content is a particular font.