What Is A Noarch Package?

What is noarch
What is noarch?.

So you are sat at your computer and you are searching through the software repositories looking for something to install when you notice that there are a number of files with the extension noarch.

What is noarch and why do so many files have this extension?

Essentially the noarch stands for no architecture.

At this point you may be wondering why somebody has bothered to create a package that doesn't work on any architecture.

The term noarch actually means no particular architecture or if you will, all architectures.

How is this possible? How is it possible that a package will work on all versions of Linux, Windows and other operating systems.

Well, for a start not all packages contain applications. For example the application gnome-backgrounds.arch is a collection of desktop backgrounds. Whilst the package has been developed for the Gnome desktop environment it really is just a collection of images and the images are created in universal formats which can be used on any modern operating system.

Therefore you can think of a noarch package as anything that is truly universal such as backgrounds, icons and even manuals.

Noarch packages can also contain scripts, programs and applications but they have to contain files which are truly cross platform.

What sort of programs are truly cross platform?

Web applications developed in HTML, JavaScript and CSS are universal as are the PHP, PERL and Python scripting languages.

Compiled programs cannot be considered noarch because they are compiled to work on a specific architecture. Therefore C and C++ binaries will not be found in a noarch file. The exception to this rule are Java programs because Java is truly cross platform and a Java application written for one Linux distribution and architecture should also work on other Linux platforms and on Windows.

Now you may think that source code can be kept as noarch packages because it can be compiled cross platform and it is only the binaries that are specific to a particular architectures. Source code packages are actually stored with the src extension.

Noarch files are generally associated with RPM packages.

It is highly likely that you already have a number of RPM noarch packages already installed on your computer.

To find out which noarch packages you have installed run the following command:

rpm -qa --qf "%{N}-%{V}-%{R}\t\t%{ARCH}\n" | grep noarch | more

The above command can be broken down as follows:

  • rpm is the package manager
  • -q stands for query
  • -a stands for all
  • --qf stands for query format
  • The output from the rpm command is placed as the input to grep which looks for noarch
  • More makes the output stop at the end of a page of data, you can move on to the next page by pressing space

Looking at the output of the above command on my own computer I can see a number of font packages, firmware packages, documentation, backgrounds, icons and themes.

A word of warning however. Just because something is packaged as noarch it isn't always sensible to copy the files within this package to other computers and hope that they work.

For instance if you have one computer running Fedora using the RPM package manager and another running Debian using the DEB file format it makes sense to look for the equivalent package on Debian before copying the files over from the Fedora machine.