What Is a Noarch Package?

How can a package have no software architecture?

Using noarch package on a computer screenshot

Noarch stands for no architecture. Actually, the term noarch means no particular architecture or if you will, all architectures. It references files, such as images, manuals or even applications that are universal across all platforms.

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 is 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 architecture. 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.