[root tip] [How To] Avoid common pitfalls as developer

Spend your time coding

As a long time developer - using Arch and Manjaro - I can tell from experience - having your workflow broken is extremely stressing - especially due to system issues.

Issues you can avoid and I will share with you - how to avoid them.

Spend your time coding instead of fixing system issues.

Development tools

Users new to Manjaro and development is often trapped with unnecessary problems and issues, due to how Manjaro and Arch package management works.

When using Python, NodeJS and JetBrains tools using a simple set rules and you will avoid issues which otherwise would have cost you hours to fix.

Qt 5/6 Toolkit

Upstream Qt only supports a few distributions and they insist on using the unified installer which requires a developer registration.

Because Manjaro is a rolling release this approach may prove difficult as there is no guarantee the unified installer matches what is available in upstream ArchLinux stable repos - which is the same packages Manjaro Linux uses in the edge branch (unstable).

This may create issues and the unified installer is unsupported on Manjaro Linux

Qt on Manjaro

Qt tools is available in the official repos.

The tools is available using different packages - where many is already present as dependencies for other packages.

Packages

The package qt{5,6}-tools contains the tools and is often installed as several packages depends on the functionality provided

The content of the packages changes over time when the tools are updated.

As of April 2024

Package Qt Framework Provides
qt5-tools all Qt Designer
all Qt Assistant
all Qt Linguist
all Qt QDBusViewer
qt6-tools 6 Qt 6 Tools QtHelp
qtcreator all IDE
qtcreator-devel all scripts, libs, headers

Modules

A wide variety of Qt modules is available and some but certainly not all is readily available.

If you need specific Qt functionality search the official repo for modules targeting specific versions of the framework

E.g. to search for qt5 modules

pamac search qt5 --no-aur

And the equivalent for qt6

pamac search qt6 --no-aur

Qt4

Qt4 has been deprecated and should not be used. In the unlikely event you need something they may be available as custom builds - those are unsupported and build at your responsiblity

pamac search qt4 --aur

Python

Always install system wide packages using pacman

sudo pacman -Syu python-pkgname

NEVER use sudo pip

This is likely to create maintenance Failed to commit transaction issues at a later stage so avoid

sudo pip install pkgname

If you need PyPi package use the --user argument and from 3.11 and onwards you add --break-system-packages. This has been implemented upstream to ensure the user is aware of the implications.

pip install --user --break-system-packages pkgname

Another option is pipx

sudo pacman -Syu pipx

Then you can do

pipx install <pkgname>

Use a virtual environment if you need PyPi

Install a virtual environment using pacman - one example is python-virtualenvwrapper

sudo pacman -Syu python-virtualenvwrapper

Then source the wrapper script in your .bashrc or .zshrc or on the commandline

source /usr/bin/virtualenvwrapper.sh

Use commands like

mkvirtualenv my-project

Cd to your project folder and run your scripts - install the python packages needed etc.

To set your python environment for my-project

workon my-project
pip install numpy

When you are done

deactivate my-project

Node JS

Nodejs is often installed as dependency for other packages e.g. Electron based apps.

Never mess with the system nodejs.

Never install node packages using sudo

This also likely to create maintenance Failed to commit transaction issues at a later stage so avoid

sudo npm install -g gulp
sudo npm install http

Use a node version manager

One option is to use pnpm which is a nodejs package manager for your project (packaged for Manjaro by @Yochanan )

sudo pacman -S pnpm

Another option is NVM a node version manager - which installs, runs and maintain nodejs in your home folder - and you can install and run different versions of nodejs - something that is impossible using the package manager - where you will always be forced to use a specific version

sudo pacman -S nvm

Install a nodejs interpreter - you can install several if necessary and switch between them

nvm install node

Then install node packages - even global packages - using commands like this

npm install -g gulp
npm install http

JetBrains tools

You can install JetBrains tools from AUR - but they are installed into /opt and thus requires superuser when the tool informs you that updates are available.

It is better using the Jetbrains Toolbox App to install the tools.

If you are using a single app e.g. PyCharm, PhpStorm or WebStorm and you don’t want or need the Toolbox

  • download the archive
  • unpack it in your home.
  • navigate into the unpacked folder
  • run the app’s launcher script from the bin folder.

Android Studio

Android Studio is based on IntelliJ - the core of all JetBrains tools - install it using the Toolbox App or download from android.com

  • download the archive
  • unpack it in your home.
  • navigate into the unpacked folder
  • run the app’s launcher script from the bin folder.

dotnet core SDK

The packages in the repo is mostly runtime packages.

As developer you want all binaries provided by the current dotnet core LTS and there is only one viable method to achieve this on one step using an Arch based distribution.

This is a custom package - jump to the custom dotnet package article to learn how.

To educate yourself on use of AUR and why it is unsupported please jump to article About Manjaro and AUR

Conclusion

Have fun developing and educating yourself in the fantastic and endless world of coding.

14 Likes

8 posts were split to a new topic: Discussion about avoiding common pitfalls as developer

Another simple option

Use pipx instead of pip, it creates an environment in your home directory.
It is available in pacman repos.

Closely related to pip, but creates, for the user running it, an isolated environment for each application and its associated packages, preventing conflicts with system packages. Focused on packages that can be run from the command line directly as applications. You can use pipx to install packages from the Python Package Index and other indexes.

Source: Python - ArchWiki

1 Like