问题原文
原帖链接 · A. R. Diederich · CC BY-SA 3.0
End state. I want to reformat my / partition, reinstall opensuse tumbleweed, and have the same packages installed then as now.
Problem. I made what appears to be a poor choice, formatting the root filesystem as btrfs. The 20 GB I had for it was plenty previously with, say, ext3, but I can't keep up with the snapshot management with snapper with the large number of updates tumbleweed does.
Partial success. I can export my repository list with sudo zypper lr -u --export repo.list, and add that back to a fresh install with sudo zypper addrepo repo.list. I can export a list of installed pakcages with sudo zypper search --installed-only > installed.packages or rpm -qa | sort.
But I don't know how to install packages from a list, or generate a list of packages that can be used by opensuse at distribution install time.
Edit: autoyast may be the way to go, but is more heavyweight than I was looking for.
已采纳解答
原帖链接 · y5nijpn6qc3 · CC BY-SA 3.0
Use --queryformat to list package names without version
rpm -qa --qf "%{NAME}\n" > installed_pkgs.txt
To install, pipe content of the file to xargs
cat installed_pkgs.txt | xargs sudo zypper install
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
