Move an apt Package List Between Systems with manifest
You need the same packages on a second Ubuntu box, and byobu's manifest command exports the first machine's dpkg list for manifest import to replay. It manages packages through dpkg and apt, not byobu configuration. Allow about five minutes for an export and inspection.
The route
Jump straight to the step you need, or tick off Done means at the end.
You need a shell account able to run dpkg -l; exporting needs no elevated privileges. Importing changes the system and normally asks for sudo.
1. Confirm the local version
Check that the command and its package are installed:
command -v manifest; dpkg-query -W byobu
On the system used for this guide, the command is /usr/bin/manifest from byobu 6.11-0ubuntu1.1, with a manual page dated 28 February 2016. Its scope is deliberately narrow: the manual page says it is compatible with apt and dpkg, not any other package manager.
2. Export to a local file
Use a filename when you want a durable, reviewable manifest. The command creates or replaces that file, so choose a new path or back one up first:
manifest export /tmp/source-packages.txt
manifest runs dpkg -l and writes its complete output there. Check that the file exists and starts with the package-list header:
test -s /tmp/source-packages.txt && sed -n '1,5p' /tmp/source-packages.txt
You should see headings starting with Desired= and Status=, followed by a table of package names, versions and architectures. Keep the file private if your installed package set is itself sensitive: it holds no package contents, but it does reveal what software runs here.
3. Review what you are actually carrying forward
The manifest is the human-readable output of dpkg -l, not a bare list of names. Installed packages have a status line starting with ii. Count and spot-check a few before transferring the file:
awk '$1 == "ii" { count++ } END { print count " installed package entries" }' /tmp/source-packages.txt; awk '$1 == "ii" { print $2 " " $3 }' /tmp/source-packages.txt | sed -n '1,20p'
Warning
Do not hand-edit the file into a shortened list unless you understand the status columns. manifest import filters for lines whose first field is ii, then reads the package-name column, so turning any line into something that looks installed makes it an import candidate.
4. Choose a transfer method deliberately
You have three export destinations. A local file is the safest default because you control where the data lands. A hyphen writes the same listing to standard output instead:
manifest export - > /tmp/source-packages-from-stdout.txt
Warning
Leave the destination off entirely and manifest export defaults to the URL http://paste.ubuntu.com. When the destination looks like a URL, the script compresses and base64-encodes the listing, then submits it with pastebinit, a network upload that can expose this machine's package inventory to a paste service. It also needs pastebinit installed, and stops with an install hint if that is missing.
For a controlled transfer, copy /tmp/source-packages.txt through your own approved file-transfer method instead. There is no need to publish a package list just to move it between two machines you control.
5. Import only after checking the target
Copy the reviewed file across, then import it by explicit path:
manifest import /tmp/source-packages.txt
Warning
This is state-changing. The installed script extracts installed package names and runs sudo apt install, which can pull in dependencies, hit network repositories, and prompt for confirmation. It does not remove packages that exist only on the target, and it does not restore exact versions or config files just because they appeared in the source listing.
Review the apt transaction before accepting it. Answer no if the proposed set looks wrong. If you accept an unwanted install, there is no generic undo built into manifest: identify the packages from apt's transaction history and remove them through your normal process, after checking their dependencies.
The standard-input form suits a pipeline, but it is still an installation:
cat /tmp/source-packages.txt | manifest import -
The URL form downloads a paste, decodes and decompresses it, filters the package list, then calls sudo apt install the same way:
manifest import https://paste.example.invalid/PASTE-ID
Only use a trusted URL containing a manifest you have already verified. manifest trusts whatever it downloads as package input; it performs no signature or provenance check.
Common traps
- Confusing export with a backup. The manifest records package selections, not archives, application data, service state or config files.
- Expecting cross-distribution portability. This utility is built around Debian package tools and apt, not a general RPM, Alpine or cross-distro format.
- Forgetting the destination. An omitted export target hits the paste service rather than printing locally. Use a hyphen when you actually want standard output.
- Treating import as a dry run. There is no dry-run option here. Rely on apt's own review and confirmation prompt before accepting anything.
Done means
- manifest export /tmp/source-packages.txt completed successfully.
- The file was inspected and its ii entries look expected.
- A local or explicitly approved transfer path was used.
- Any import was reviewed in apt before confirming.