#Backing up system packages

134 messages · Page 1 of 1 (latest)

grizzled tinsel
#

My friend backed up my home directory to a diffrent drive, named home.ext4, my arch was broken thanks to windows. So I made two log files, Pacman -Q and flatpak list

I piped the output to the files I wanted, now I need a command to restore the packages, by installing them, from the log file, I have alot of packages so I'm not doing manual, also how do i account for dependecies

safe prawn
#

try to repeat the pacman -Q bit but with

  1. explictly installed : pacman -Qenq > explicit.pacman
  2. dependencies : pacman -Qdnq > deps.pacman
  3. aur : pacman -Qemq > explicit.aur
  4. aur deps : pacman -Qdmq > deps.aur

with this all you need to do to install is

cat explicit.pacman > sudo pacman -S --asexplicit -

cat deps.pacman > sudo pacman -S --asdeps -

cat explicit.aur > paru -S --asexplicit -

cat deps.aur > paru -S --asdeps -


and also the flatpak biut seperate runtimes and apps in flatpak
1. apps : `flatpak list --app --columns=application,branch | awk '{print $1 "//" $2}' > apps.flatpak`
2. runtimes : `flatpak list --runtime --columns=application,branch | awk '{print $1 "//" $2}' > runtimes.flatpak`

with this all you need to do to install is

flatpak install $(cat apps.flatpak)

flatpak install --no-auto-pin $(cat runtimes.flatpak)
```
grizzled tinsel
#

@safe prawn I'm thinking about writting a script that looks at a packages dependencies then registers it under that package, later tho, currently ill do vista's thing then later the script will Uninstall packages meant as dependencies

#

I wish there was like a package manager for these advanced stuff

#

Thanks

ripe brookBOT
#

vistaman received a thank you cookie!

safe prawn
grizzled tinsel
#

So to get it for flatpaks I change the pacman -S command?

#

That's iy

safe prawn
grizzled tinsel
#

One sec

#

Uhh

#

I can't enable network manager

safe prawn
#

you don't use nm in the archiso

#

you use iwd

#

they have done that

grizzled tinsel
#

I enabled it

#

Already

safe prawn
#

anyways

do you still have access to your old arch system?

grizzled tinsel
#

I booted up in system

safe prawn
#

have you formatted the old arch system?

grizzled tinsel
safe prawn
#

if you haven't you can chroot into it and create the files i mention

#

enable doesn't start a service

signal oasis
#

yo do y'all need help

safe prawn
#

just tells a service to start at boot

grizzled tinsel
safe prawn
#

enable --now
makes it start at boot and currently

start just starts the service

grizzled tinsel
#

Bus

signal oasis
#

why not pacman -S --needed $(cat file.txt)

safe prawn
signal oasis
#

help explaining or dealing with anything

safe prawn
#

networkmanager is not availabel in the iso

#

use iwd as per install guide

grizzled tinsel
signal oasis
#

i might be wrong, maybe that was wifi-menu??

safe prawn
signal oasis
#

what does ! $i =~ ^[0-9] mean

safe prawn
#

you need to parse it to not include package version

#

of course unneeded if it was the output of -Qq

signal oasis
#

so? you can still install??

grizzled tinsel
signal oasis
#

oh ig not nvm

#

mb

safe prawn
#

why not use awk to seperate each line using space as the delimiter and then use the first column

grizzled tinsel
signal oasis
#

btw use $(< file.txt) not `cat file.txt`

grizzled tinsel
#

Nmtui works

#

Mvm

signal oasis
#

hm

grizzled tinsel
#

Nvm

signal oasis
#

it just runs faster
ig you could use `` but most people don't cause its confusing

#

whatevs

#

yea ig

#

ok so whats the issue rn

grizzled tinsel
#

One sec

signal oasis
#

programming sucks sometimes

grizzled tinsel
#

I'll use this

signal oasis
#

sure

grizzled tinsel
#

I assume it's correct

#

3

#

2

#

1

#

I'm adding the -y flag

#

Heh

#

Tf happened

#

How do I check

#

Bin/bash

#

Got it

#

UGH

#

Y flag didn't work

#

What's the skip ask flag?

#

--noconfirm

#

Before -S?

#

Or after pkg nane

#

Works

#

Now time to wait and see

#

My friend made a ext4 file, how do you do that? Like my whole home was in a ext4 file

#

If somethings installed as a dependeny

#

And it comes up in the log

#

Will it install it again?

#

Shit uhh

#

It'll install kde

#

When it does

#

I'll need to make a script which reorganizes stuff

#

When a package is installed the whole dependency tree is right?

safe prawn
safe prawn
grizzled tinsel
#

Uhhh

#

Cntr c and add needed flag?

safe prawn
#

if pacman is still in downloading phase, it's safe to ctrl + c

grizzled tinsel
safe prawn
#

why reinstall?

#

--needed is to avoid any redundant reinstallation

grizzled tinsel
safe prawn
#

no duplicates are made with pacman

grizzled tinsel
#

Is there any way to delete dupe

safe prawn
#

what happens is that things gets reinstalled

grizzled tinsel
#

That's what I was worried about

safe prawn
#

--needed avoids unnecessary reinstallation
just doing the needed operations

#

since you'll be looping your list from pacman -Q, without --needed,
you are reinstalling may things too many times,
hence i recommended the --needed flag

#

this is a pacman thing, not a bash thing, dont' worry

#

what i meant with the awk thing btw

#

of course pacman supports not listing version at all

#

still applies

#

awk is a language mainly used for parsing text

#

yeah

#

all print$1 does is print the first 'column' by default space is the delimiter to seperate things

#

since packages are listed as
package-name version
in every line

#

as you can see, works just fine

grizzled tinsel
#

I saved my user dir

#

I need that for my user

steep pagoda
#

same username?

grizzled tinsel
steep pagoda
#

just add one without a home dir

#

and change the perms for the existing folder

errant mantle
# grizzled tinsel My friend backed up my home directory to a diffrent drive, named home.ext4, my a...

Might I suggest that you consider aconfmgr as a potential option? This tool keeps track of modified files and file properties, in addition to managing syncdb and alien packages.

GitHub

A configuration manager for Arch Linux. Contribute to CyberShadow/aconfmgr development by creating an account on GitHub.

grizzled tinsel
#

I should have used timeshift but that only preserves home dir

grizzled tinsel
safe prawn
#

you have flatpak list-ed your packages so

#
flatpak install --no-auto-pin $(cat flatpak-package-list-file | awk '{print $2"//"$3}')