Score:2

How to tar xf glib-*.tar.gz correctly?

na flag

I downloaded glib-2.76.3.tar.xz from https://download.gnome.org/sources/glib/2.76/

Extracted the file and opened the INSTALL.md inside of it.

Here's an excerpt of it:

Simple install procedure
========================

```sh
tar xf glib-*.tar.gz                    # unpack the sources
cd glib-*                               # change to the toplevel directory
meson _build                            # configure the build
ninja -C _build                         # build GLib

# Become root if necessary

ninja -C _build install                 # install GLib

I ran sh on terminal, but when I run tar xf glib-*.tar.gz it throws error:

tar: glib-*.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

As I understand I have to write something instead of the * but I don't know what exactly.

tar xf glib-2.76.3.tar.gz throws the same type of error. Maybe I'm in the wrong directory also?

hr flag
If you downloaded the `.xz` compressed archive rather than the `.gz` compressed archive, your need to modify the filename in the `tar` command accordingly i.e. `tar xf glib-*.tar.xz`
Score:2
vn flag

The documentation is clearly wrong on several details, since it states a .gz extension, but the actual file has an .xz extension.

So if you're in the directory where the file is located, you can run:

tar xf glib-*.tar.xz

Or you can run the exact filename:

tar xf ./glib-2.76.3.tar.xz

Instead of the . you can also specify the full path, like this:

tar xf /path/to/glib-2.76.3.tar.xz

Also for the next command (cd) use: (here the cd glib-* will not work)

cd glib-2.76.3

Or full path again:

cd /path/to/glib-2.76.3

I cases like this, documentation should be seen as guidance, that can contain errors - always double check with common sense.

ilkkachu avatar
co flag
Note that using the wildcard for the tarball assumes there's only one matching filename. It might work with `cd` too if you append a trailing slash, that should make the shell match only directories (thus skipping the tarball), i.e. `cd glib-*/`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.