The officially official Devuan Forum!

You are not logged in.

#1 2025-03-09 00:38:32

torquebar
Member
From: Baie des Chaleurs
Registered: 2021-09-15
Posts: 80  

How to import a synaptic exported package list?

I want to import the package list exported by synaptic on another computer with

apt list > packlist-box-A.txt

The man page is quite simple and short, it explains the list option but not its reverse.

(Edited and Un-edited mistakenly by fsmithred. Sorry about that.)

Last edited by fsmithred (2025-03-09 12:59:08)


Who, has loved us more?

Offline

#2 2025-03-09 09:30:23

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,564  

Re: How to import a synaptic exported package list?

I don't know if that's meant for making install lists.  Feeding the list to apt install is possible, but might not be the best way. In the past, I've used 'dpkg --get-selections' 'dpkg --clear-selections'  and 'dpkg --set-selections' to make an install list and use it on another machine.

Offline

#3 2025-03-09 09:36:46

Andre4freedom
Member
Registered: 2017-11-15
Posts: 179  

Re: How to import a synaptic exported package list?

Check this:

https://askubuntu.com/questions/541781/ … ng-apt-get

Could this be an answer? (I haven't tried it)

Offline

#4 2025-03-09 11:21:37

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,564  

Re: How to import a synaptic exported package list?

To use one of the methods Andre linked, you need to get a list of just package names (filter out the versions) like this (or equivalet.):

SOMETHING BETTER THAN THIS!!!  I didn't realize that 'apt list' just lists everything in the repo. You do not want to install more than 59,000 packages. See Delgado's post below or use 'dpkg -l' to see what's installed. (The awk would need to be modified.)

apt list | awk -F"/" '{ print $1 }'  > package-list

Last edited by fsmithred (2025-03-09 13:02:55)

Offline

#5 2025-03-09 11:31:04

Andre4freedom
Member
Registered: 2017-11-15
Posts: 179  

Re: How to import a synaptic exported package list?

Thank you for that precision

Offline

#6 2025-03-09 12:09:53

delgado
Member
Registered: 2022-07-14
Posts: 228  

Re: How to import a synaptic exported package list?

I suggest to insert some filters

apt list | \
grep 'installed' | grep -v -e 'installed,local' -e 'installed,automatic' -e ^lib | \
awk -F"/" '{ print $1 }'  > package-list

^lib : removes all libraries (should be installed automatically), but also "libreoffice".
'installed,local' : packages not in the current sources.list. I would want to check those.

Edit:
Forgot to mention: To apply to a new installation

apt-get install $(cat package-list| tr -d '\n')

tr -d '\n' deletes end-of-line characters.

I like fsmithred's 'dpkg --get-selections' version; it includes de-installation of packages, which it not covered here.

Last edited by delgado (2025-03-10 01:30:52)

Offline

#7 2025-03-15 10:54:12

torquebar
Member
From: Baie des Chaleurs
Registered: 2021-09-15
Posts: 80  

Re: How to import a synaptic exported package list?

Thank you all, I'm not getting the email alerts (or I missed the first and only one). Woud be nice if incorporated into Synaptic like Suse put it into Yast.

Last edited by torquebar (2025-03-15 11:44:12)


Who, has loved us more?

Offline

#8 2025-03-15 13:44:07

torquebar
Member
From: Baie des Chaleurs
Registered: 2021-09-15
Posts: 80  

Re: How to import a synaptic exported package list?

I like fsmithred's 'modular' approach since I don't really have the badwidth to deal with one-liners of more than two words (got the desease from Bush jr.)

'dpkg --get-selections'
'dpkg --clear-selections'
'dpkg --set-selections'

I have never used dkpg, so if I understand correctly, in the order

--get-selections  lists the actually installed operative package names, much as would Suse Yast's 'export' option.

--clear-selections  ..having a problem with this.  How do you mark for deinstallation on a list that is given only later (next)?

--set-selections executes the listed package-name according to the trailing mode-spec (one of install, hold, deinstall or purge).


Who, has loved us more?

Offline

Board footer