You are not logged in.

#1 2021-03-12 20:58:26

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

[SOLVED]Removing everything but essential packages kills pacstrap

Greetings smile

I'm finally attempting the switch to linux and have settled on arch as the most appropriate way to do this.  A big priority is keeping the system as clean as reasonably possible.  In that spirit, my intention is to wipe the system each time I make a mistake, unless the re-install starts getting really long.  Unfortunately, the instructions for doing this,https://wiki.archlinux.org/index.php/Pa … l_packages (when run in the linux live session booted from USB), create a problem:

# pacman -D --asdeps $(pacman -Qqe)
# pacman -D --asexplicit base linux linux-firmware
# pacman -Qtdq | pacman -Rns -

# pacstrap /mnt --needed nano
zsh: command not found: pacstrap

This is after I've run pacstrap to install something (test was with sudo..), to confirm it worked previous to getting rid of the packages.  I've tried marking pacstrap as explicit so it won't be removed, that doesn't work. 

error: could not set install reason for package pacstrap (could not find or read package)

 
I've wondered if it's just part of another package and that therefore I should mark -that- package as explicit, but I really doubt that's the problem, so I haven't researched it that much. 

I tried this:  https://archlinuxarm.org/forum/viewtopi … =60&t=8529
and got:

error: target not found: pkgfile

Re-booting from the USB brings pacstrap back, but it seems that shouldn't be necessary.

To thicken the plot, I checked what would happen if I really did try to remove everything, by not marking anything as explicit:

# pacman -D --asdeps $(pacman -Qqe)
# pacman -Qtdq | pacman -Rns -
4 lines of output followed by:
warning: dependency cycle detected:
warning smbclient wil be removed after its cifs-utils dependency
warning: pacman is designated as a HoldPkg.
:: Hold Pkg was found in target list.  Do you want to continue? [y/N]

I don't think I've ever said yes to that, it looks like bad things will happen.  The impression I get is that once you start installing things with pacstrap, even just the basics, base linux linux-firmware, removing it isn't as simple as the given instructions indicate.

..so now what I'm left with is running this code:

# pacman -D --asdeps $(pacman -Qqe)
# pacman -D --asexplicit base linux linux-firmware
# pacman -Qtdq | pacman -Rns -

, then running https://wiki.archlinux.org/index.php/pa … kage_cache

# pacman -Scc

then re-booting back into the live environment to get pacstrap back, crossing my fingers and re-starting the installation. 

..so to end with a question, is rebooting necessary?  What is the elegant clean way of doing this?  Is there one? Thanks! smile

Edit:  I'm aware that pacstrap can be re-built, there's a section in the wiki on that.  But that seems just as clumsy as re-booting, if not more so.

Last edited by mikethe1wheelnut (2021-03-12 23:44:32)

Offline

#2 2021-03-12 21:01:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:

my intention is to wipe the system each time I make a mistake...

That's a great way to memorise the install process, and a terrible way to learn from your mistakes.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2021-03-12 21:03:56

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

    # pacman -D --asdeps $(pacman -Qqe)
    # pacman -D --asexplicit base linux linux-firmware
    # pacman -Qtdq | pacman -Rns -

Why do any of the above if you are goign to wipe the installation?

    # pacstrap /mnt --needed nano
    zsh: command not found: pacstrap

You already have an installed system so what is this command meant to achieve?

Offline

#4 2021-03-12 21:10:53

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

jasonwryan wrote:
mikethe1wheelnut wrote:

my intention is to wipe the system each time I make a mistake...

That's a great way to memorise the install process, and a terrible way to learn from your mistakes.

..my perspective is somewhat different - there's enough learning happening and required already that this seems an expedient way of keeping momentum going until I'm ready to absorb the rest of the material.  I've tried to learn languages from friends, and ended up giving up when they were overly insistent on perfect pronunciation.

Offline

#5 2021-03-12 21:17:16

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

loqs wrote:
    # pacman -D --asdeps $(pacman -Qqe)
    # pacman -D --asexplicit base linux linux-firmware
    # pacman -Qtdq | pacman -Rns -

Why do any of the above if you are goign to wipe the installation?

When you say "wipe the installation", what do you mean?  Are you saying that -by rebooting- the entire installation is automatically wiped?  (this would be new information for me)

loqs wrote:
    # pacstrap /mnt --needed nano
    zsh: command not found: pacstrap

You already have an installed system so what is this command meant to achieve?

This command is only intended to be run once all the packages I've installed have been removed.  Once I've done more research, I'll know how to remove only the packages I've installed that I subsequently decide I don't want anymore.

Offline

#6 2021-03-12 21:22:10

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:

When you say "wipe the installation", what do you mean?  Are you saying that -by rebooting- the entire installation is automatically wiped?  (this would be new information for me)

It would also make sense.  But re-booting is still time-consuming, obviously.  The original issue remains that removing installed packages breaks pacstrap, which doesn't seem right.

Offline

#7 2021-03-12 21:31:40

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:
loqs wrote:
    # pacman -D --asdeps $(pacman -Qqe)
    # pacman -D --asexplicit base linux linux-firmware
    # pacman -Qtdq | pacman -Rns -

Why do any of the above if you are going to wipe the installation?

When you say "wipe the installation", what do you mean?  Are you saying that -by rebooting- the entire installation is automatically wiped?  (this would be new information for me)

mikethe1wheelnut wrote:

In that spirit, my intention is to wipe the system each time I make a mistake, unless the re-install starts getting really long.

Yet the wiki package you link to and the commands above will not wipe an installation,  they will remove packages not marked as explicitly installed.  It does not remove files that are not tracked by pacman such as anything in /home or any log files or the package cache or the pacman database and log.  Typically you would wipe an installation by formatting all of the installations partitions.

mikethe1wheelnut wrote:
loqs wrote:
    # pacstrap /mnt --needed nano
    zsh: command not found: pacstrap

You already have an installed system so what is this command meant to achieve?

This command is only intended to be run once all the packages I've installed have been removed.  Once I've done more research, I'll know how to remove only the packages I've installed that I subsequently decide I don't want anymore.

That does not explain what you expect the command to do.  You already have pacman installed so why use pacstrap?  Why specify /mnt?  Why specify nano without base linux linux-firmware?

Last edited by loqs (2021-03-12 21:32:26)

Offline

#8 2021-03-12 21:34:57

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

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:

Are you running Arch or ArchARM?
They're different distros and there is absolutely no guarantee that commands meant for one of them will work on the other.

The pacstrap command isn't installed by default, it's part of the arch-install-scripts package and it makes no sense to use it on an already installed OS, it's only designed to install Arch on a blank drive (or container).


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

#9 2021-03-12 21:40:01

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

Slithery wrote:
mikethe1wheelnut wrote:

Are you running Arch or ArchARM?
They're different distributions...

Arch.  The -only- reason that's there is to give indication of some of the research I've done to try to solve the problem.

Slithery wrote:

The pacstrap command isn't installed by default, it's part of the arch-install-scripts package and it makes no sense to run it from an installed OS, it's only meant for installing Arch on a blank drive (or container).

..and here I'm trying to run it from an arch live session from a usb, on a drive that .. hasn't been explicitly just created or formatted.  But it not working is different from it not being found at all..

Last edited by mikethe1wheelnut (2021-03-12 21:44:19)

Offline

#10 2021-03-12 21:48:49

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

    zsh: command not found: pacstrap
mikethe1wheelnut wrote:

But it not working is different from it not being found at all.

Are you referring to some other output you have not posted?

Offline

#11 2021-03-12 21:51:19

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

loqs wrote:

Yet the wiki package you link to and the commands above will not wipe an installation,  they will remove packages not marked as explicitly installed.  It does not remove files that are not tracked by pacman such as anything in /home or any log files or the package cache or the pacman database and log.  Typically you would wipe an installation by formatting all of the installations partitions.

Indeed, I hadn't thought of (re)formatting the partitions..  /home has nothing in it (don't think..), I've cleared the package cache separately, but the rest.. is research still to do.   Now you mention it, until I gain much more clarity and confidence, (re)formatting sounds like an excellent idea. :-)

That does not explain what you expect the command to do.  You already have pacman installed so why use pacstrap?  Why specify /mnt?  Why specify nano without base linux linux-firmware?

I expected the command to re-install nano if it wasn't already there.  nano was a random choice, a small program that should install quickly if pacstrap worked.  /mnt was specified to follow the instructions in the wiki.

Offline

#12 2021-03-12 21:54:58

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

At the point in the installation you execute pacstrap the system is mounted to /mnt with / being the installation media.
Running it from the installed system with no system mounted to /mnt would fail even if the command was installed.
You should not pacstrap on the installed system just use pacman.

# pacman -D --asdeps $(pacman -Qqe)
# pacman -D --asexplicit base linux linux-firmware nano
# pacman -Qtdq | pacman -Rns -

As nano is added to the list of packages marked as explicitly installed it will then not be removed so you do not need to reinstall it.

Last edited by loqs (2021-03-12 21:55:36)

Offline

#13 2021-03-12 22:01:52

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

loqs wrote:
    zsh: command not found: pacstrap
mikethe1wheelnut wrote:

But it not working is different from it not being found at all.

Are you referring to some other output you have not posted?

-No.  You said:

loqs wrote:

The pacstrap command isn't installed by default, it's part of the arch-install-scripts package and it makes no sense to run it from an installed OS, it's only meant for installing Arch on a blank drive (or container).

..that seems to indicate that the command is only supposed to be run -once-, on a blank drive.  So even running it twice (say you have a super long list of software you want installed), would be a mistake.  (which I doubt is the case, since I've done this and it seemed to work fine).  But even if you ran it more than once, or tried to run it from an installed OS (I think I tried this and of course it didn't work..), I presume it would give an error different from "it can't be found".  -that "zsh: command not found: pacstrap" comes from running it in the linux live session..

Last edited by mikethe1wheelnut (2021-03-12 22:03:12)

Offline

#14 2021-03-12 22:08:06

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

pacstrap --needed /mnt nano
==> ERROR: pacstrap: invalid option -- '-'

Last edited by loqs (2021-03-12 22:17:33)

Offline

#15 2021-03-12 22:08:18

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

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:
# pacman -D --asdeps $(pacman -Qqe)
# pacman -D --asexplicit base linux linux-firmware
# pacman -Qtdq | pacman -Rns -

# pacstrap /mnt --needed nano
zsh: command not found: pacstrap

If you are running these commands from the Live USB then they are performing those actions on the Live USB, not on your already installed system.

By running them you are removing the arch-install-scripts package and thus the pacstrap command from the Live USB session...

None of the above is making any changes to your already installed system.


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

#16 2021-03-12 22:18:19

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

loqs wrote:

At the point in the installation you execute pacstrap the system is mounted to /mnt with / being the installation media.

..thank's a ton for that.  It's not what I was asking about, but touches on other confusions I had.  I've tried to understand where one file system stopped and another began, but had set aside the question.   ..it sounds like for the installation, the only partitions that need to be mounted are the ones that you are going to use pacstrap to put files into.  (I was previously also mounting a partition to /home, not knowing what I was doing -but this is going off-topic now..)

loqs wrote:

Running it from the installed system with no system mounted to /mnt would fail even if the command was installed.
You should not pacstrap on the installed system just use pacman.

Understood! :-)  This post is intended to address the behavior of said commands when executed in the live session :-)

loqs wrote:

As nano is added to the list of packages marked as explicitly installed it will then not be removed so you do not need to reinstall it.

You're quite right, that is confusing.  I should have been more careful with my original post.

Offline

#17 2021-03-12 22:21:41

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

loqs wrote:
pacstrap --needed /mnt nano
==> ERROR: pacstrap: invalid option -- '-'

Confusion?  What I actually put in was:

# pacstrap /mnt --needed nano

Offline

#18 2021-03-12 22:24:20

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

Slithery wrote:
mikethe1wheelnut wrote:
# pacman -D --asdeps $(pacman -Qqe)
# pacman -D --asexplicit base linux linux-firmware
# pacman -Qtdq | pacman -Rns -

# pacstrap /mnt --needed nano
zsh: command not found: pacstrap

If you are running these commands from the Live USB then they are performing those actions on the Live USB, not on your already installed system.

By running them you are removing the arch-install-scripts package and thus the pacstrap command from the Live USB session...

None of the above is making any changes to your already installed system.

Bingo.  Now we're on to something..  ..ok, I think it's time for me to go back to the documentation, re-read it all..  I propose to come back and mark this solved if that reading resolves everything.. (!) :-D

Offline

#19 2021-03-12 22:30:44

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:
Slithery wrote:
mikethe1wheelnut wrote:
# pacman -D --asdeps $(pacman -Qqe)
# pacman -D --asexplicit base linux linux-firmware
# pacman -Qtdq | pacman -Rns -

# pacstrap /mnt --needed nano
zsh: command not found: pacstrap

If you are running these commands from the Live USB then they are performing those actions on the Live USB, not on your already installed system.

By running them you are removing the arch-install-scripts package and thus the pacstrap command from the Live USB session...

None of the above is making any changes to your already installed system.

Bingo.  Now we're on to something..  ..ok, I think it's time for me to go back to the documentation, re-read it all..  I propose to come back and mark this solved if that reading resolves everything.. (!) :-D

..huh.. except that when I re-boot from the usb again, I get pacstrap back.  So this has to mean that there are -three- beasts involved -> 1) the system getting installed, 2) the Live session, and 3) the iso on the usb-   -> because if packstrap was getting deleted from the iso, I'd have to replace the iso..  ..fascinating..

Last edited by mikethe1wheelnut (2021-03-12 22:31:52)

Offline

#20 2021-03-12 22:34:47

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

Re: [SOLVED]Removing everything but essential packages kills pacstrap

Correct.

I never said that you were removing packages from the USB stick, I said 'the live session'.

When you boot the Live USB it loads a temporary Arch install into memory, from that point on the USB stick is irrelevant. All of your actions were happening on this session, if you reboot then your computer will reload the USB to start a new 'live session'.


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

#21 2021-03-12 22:46:18

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:
loqs wrote:
pacstrap --needed /mnt nano
==> ERROR: pacstrap: invalid option -- '-'

Confusion?  What I actually put in was:

# pacstrap /mnt --needed nano

I will blame my inability to transcribe accurately on trying to understand post #13.

Offline

#22 2021-03-12 23:33:19

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

loqs wrote:
mikethe1wheelnut wrote:
loqs wrote:
pacstrap --needed /mnt nano
==> ERROR: pacstrap: invalid option -- '-'

Confusion?  What I actually put in was:

# pacstrap /mnt --needed nano

I will blame my inability to transcribe accurately on trying to understand post #13.

big_smile  lol

Offline

#23 2021-03-12 23:38:32

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

Slithery wrote:

When you boot the Live USB it loads a temporary Arch install into memory..

..so into the RAM?  ..must be..

Offline

#24 2021-03-12 23:40:59

mikethe1wheelnut
Member
Registered: 2021-03-12
Posts: 17

Re: [SOLVED]Removing everything but essential packages kills pacstrap

I feel like marking this solved.  You guys rock! big_smile

Offline

#25 2021-03-13 00:01:32

loqs
Member
Registered: 2014-03-06
Posts: 19,016

Re: [SOLVED]Removing everything but essential packages kills pacstrap

mikethe1wheelnut wrote:
Slithery wrote:

When you boot the Live USB it loads a temporary Arch install into memory..

..so into the RAM?  ..must be..

Yes see also SquashFS then a copy on write overlay is put on top of it.

Offline

Board footer

Powered by FluxBB