You are not logged in.
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
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
Check this:
https://askubuntu.com/questions/541781/ … ng-apt-get
Could this be an answer? (I haven't tried it)
Offline
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
Thank you for that precision
Offline
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
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
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