You are not logged in.

#1 2015-03-10 21:32:22

AcousticBruce
Member
Registered: 2015-03-03
Posts: 64

Is there a way to download specific base files from pacstrap base?

Lets say I tinker with something and mess up the file. I can of course redownload the entire base files using pacstrap, but is there a way to just query a specific file and download that?

Lets talk about fstab for a moment. I ran the script

 # genfstab -U -p /mnt > /mnt/etc/fstab 

and instead of using the append redirector I used only the redirect of > which clears everything other than what you are adding.

So because I do not know if there was any code and I also want to know what the original fstab file looked like. I would like to reload only this file. Is this possible? Or do I have to redownload all the base files again?

This serves 2 purposes: Learn to load only single files and to learn about the original look of the fstab file.


thank you.

Offline

#2 2015-03-10 21:40:51

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,744
Website

Re: Is there a way to download specific base files from pacstrap base?

The "original" fstab looks like your current fstab but without the "UUID=" lines.

EDIT: Sorry I see what you mean -- it just contains some commented out statements describing what /etc/fstab is -- I would tell you exactly what they were but I have deleted those lines...

If you wish to use `pacstrap` to install a single package use:

# pacstrap /mnt <package name>

Last edited by Head_on_a_Stick (2015-03-10 21:43:10)

Offline

#3 2015-03-10 21:42:28

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: Is there a way to download specific base files from pacstrap base?

fstab shouldn't be too hard to edit yourself, but if you really want to replace the file you'll want to reinstall the package that owns the file (or restore a backup). In the case of fstab this package is core/filesystem.

Remember that pacstrap is a wrapper around pacman, so everything you do with pacstrap can be done using pacman.

Offline

#4 2015-03-10 21:47:45

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Is there a way to download specific base files from pacstrap base?

You can see the original by looking up the relevant package on the Arch website.
You can find out which package the file belongs to using pkgfile.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2015-03-10 21:50:17

AcousticBruce
Member
Registered: 2015-03-03
Posts: 64

Re: Is there a way to download specific base files from pacstrap base?

runical wrote:

fstab shouldn't be too hard to edit yourself, but if you really want to replace the file you'll want to reinstall the package that owns the file (or restore a backup). In the case of fstab this package is core/filesystem.

Remember that pacstrap is a wrapper around pacman, so everything you do with pacstrap can be done using pacman.



HeadOnStick mentioned this code

# pacstrap /mnt <package name>

Does pacman have a similar code using <package name> ??


Thank you both for such a speedy response!

Offline

#6 2015-03-10 21:52:13

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: Is there a way to download specific base files from pacstrap base?

Lets say I tinker with something and mess up the file. I can of course redownload the entire base files using pacstrap, but is there a way to just query a specific file and download that?

Not easily, as far as I know. If you still have the package in your cache, that the file belongs to, you can extract the file with, e.g.

$ bsdtar -x -O -f /var/cache/pacman/pkg/filesystem-2015.02-1-x86_64.pkg.tar.xz etc/fstab > fstab

Does pacman have a similar code using <package name> ??

pacman -r /mnt -S <package name>

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#7 2015-03-10 21:55:18

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: Is there a way to download specific base files from pacstrap base?

In the case of pacman you have to change the root, which is done by using the --root option. Assuming you mounted your partition on /mnt, you can use:

pacman --root /mnt -S <package name>

But do not take my word for this and read the pacman man page. It details all kinds of useful options.

EDIT: WorMzy was quicker and has the actual correct command and I edited my post to get the order of commands right.

EDIT2: WorMzy, wouldn't your suggestion give problems with file ownership of the package?

Last edited by runical (2015-03-10 21:58:18)

Offline

#8 2015-03-10 22:25:24

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,901
Website

Re: Is there a way to download specific base files from pacstrap base?

It depends where you extract the file to. If you extract it to your home directory so you can examine it's content, there's no problem -- it's just a static file. If you're extracting it over the existing file (in this case /etc/fstab), then you may end up screwing up permissions/ownership.

I've not experimented with redirection enough to know whether the original file's permissions are preserved.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

#9 2015-03-10 22:53:40

AcousticBruce
Member
Registered: 2015-03-03
Posts: 64

Re: Is there a way to download specific base files from pacstrap base?

WorMzy wrote:

It depends where you extract the file to. If you extract it to your home directory so you can examine it's content, there's no problem -- it's just a static file. If you're extracting it over the existing file (in this case /etc/fstab), then you may end up screwing up permissions/ownership.

I've not experimented with redirection enough to know whether the original file's permissions are preserved.

maybe a chmod fix if needed?





So I am having a problem because it keeps saying fstab might be a file and when I query I do not see the package /file. So help me understand by this similar question.


This works fine.

 # pacman -S iw wpa_supplicant

but using query does not find any package that resembles iw wpa_supplicant

 # pacman -Q 

Nothing in the list resembles the package above. It seems to me I just do not understand repositories (I think that is what these are called).

Is there a good link or article that can clear this up? Also... how can I find out how to query files that contain certain characters in the package name such as lib* or *lib*?

Offline

#10 2015-03-10 23:11:31

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: Is there a way to download specific base files from pacstrap base?

fstab belongs to the filesystem package. This thread has a few different questions in it now.

man pacman

can answer a lot of those questions. The pacman wiki page can help as well. When you ran

pacman -S iw wpa_supplicant

did you install the packages? Or just see that they were found and cancel the install. Reading up on the difference between -Q and -Si on the pacman manpage can clear that up.

As far as your question about fstab itself...I'm not even sure reinstalling it will change the file anyway. Look it (filesystem) up on the packages site and see what the fstab originally looks like. Here's a link to all the files in that package: https://projects.archlinux.org/svntogit … filesystem


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#11 2015-03-11 13:15:45

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Is there a way to download specific base files from pacstrap base?

AcousticBruce wrote:

This serves 2 purposes: Learn to load only single files and to learn about the original look of the fstab file.


There is no way to install a single file from a package that I'm aware of. and if you were to extract a single file from a package and manually copy it to its place in the filesystem that file would be untracked by pacman. If you uninstalled the package later you would be left with the manually copied file, and if (more like when) you upgrade the package the upgrade would fail because of a file conflict.

The default fstab file varies from one distribution to another, and is always worthless without editing. Distributions that use automatic installers generate a unique fstab for each system, and manual distributions like Arch, CRUX and Gentoo provide nothing but boilerplate or generic filler. Downloading the original to replace what you have now will basically amount to undoing the work you've already done.

Offline

#12 2015-03-11 14:19:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,560
Website

Re: Is there a way to download specific base files from pacstrap base?

ANOKNUSA wrote:

There is no way to install a single file from a package that I'm aware of. and if you were to extract a single file from a package and manually copy it to its place in the filesystem that file would be untracked by pacman. If you uninstalled the package later you would be left with the manually copied file, and if (more like when) you upgrade the package the upgrade would fail because of a file conflict.

I don't think any of this is correct.  Extracting the 'vanilla' fstab and writing it over any existing /etc/fstab would be no different from pacman's perspective than editting the file in place which we all do.  I can edit my fstab without any issues with upgrades to the filesystem package.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2015-03-11 14:34:11

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Is there a way to download specific base files from pacstrap base?

ANOKNUSA wrote:

If you uninstalled the package later you would be left with the manually copied file, and if (more like when) you upgrade the package the upgrade would fail because of a file conflict.

How do you achieve the state of a package being installed and one or more of its files untracked?*

It's my understanding that if package foo contains /etc/bar, /etc/bar is "by definition" tracked while package foo is installed regardless of the actual origins of /etc/bar.

* Without corrupting the contents of /var/lib/pacman/local etc.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#14 2015-03-11 22:14:18

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: Is there a way to download specific base files from pacstrap base?

@Trilby, alphaniner: You're both right. I don't know where my wires got crossed, but the bit about pacman's file tracking in my last post is glaringly wrong and can be disregarded. If a package is already installed then the existence of the file means the same thing to pacman regardless of its origin. I knew that, too, because I've done it myself. I feel like a jackass. roll

Offline

Board footer

Powered by FluxBB