Active2 months ago
I'd like to output a list of all installed packages into a text file so that I can review it and bulk-install on another system. How would I do this?
Another alternative that you can use to list the installed software packages on your Ubuntu VPS is the dpkg command. Sudo dpkg -l The output of the command will provide you with information such as the name of the package, version, architecture and short description about the package. After installing Ubuntu, you may need some of your favorite software which will come handy to complete the task. So I am here to help you with a small list of best useful Ubuntu software which obviously not following any specific order. Best and Useful Ubuntu Software.
- Canonical is the global software vendor that provides commercial, design and engineering support to the Ubuntu project. Today, our hardware enablement team supports the pre-installation of Ubuntu on more than 10% of all new PCs shipped, worldwide. Learn more about how we support Ubuntu.
- Ubuntu 16.10 (Yakkety Yak) Other improvements include a new version of Ubuntu Software that supports faster loading, better support for installing command-line-only non-GUI applications, support for installing fonts and multimedia codecs and introduction of paid applications. It is based on Linux kernel version 4.8.
- Commandline: apt install ubuntu-software Listing recently installed packages The history log of apt is quite useful because it shows the time when the apt command was run, the user who ran the command and the packages that were installed by a command.
There are a lot more apps that can go on the list but the idea is to make a blanket case for Ubuntu users. Nevertheless, if I failed to mention any apps that are a must-have for your line of work feel free to make your suggestions as well as edits in the comments section.
3,53744 gold badges2424 silver badges5252 bronze badges
IvanIvan22.7k6060 gold badges137137 silver badges200200 bronze badges
24 Answers
The
apt
tool on Ubuntu 14.04 and above makes this very easy.To get a list of packages installed locally do this in your terminal:
(The
-v
tag 'inverts' grep to return non-matching lines)To get a list of a specific package installed:
To save that list to a text file called
packages
on your desktop do this in your terminal:Alternatively, simply use
(you don't need to run any of these commands as the superuser, so no
fosslinuxsudo
or any other variants necessary here)2,48322 gold badges2121 silver badges3838 bronze badges
SabaconSabacon28.6k44 gold badges2828 silver badges3939 bronze badges
To get just the packages which were expressly installed (not just installed as dependencies), you can run
This will also include a brief description, which you may want. If not, also add the option
-F '%p'
, as mentioned by karthick87.Yet another option seems to be to copy the file
/var/lib/apt/extended_states
, which is a text file database in this format:Auto-Installed: 0
indicates that the package was expressly installed and is not just a dependency.9,16055 gold badges4141 silver badges5151 bronze badges
intuitedintuited5,44933 gold badges2222 silver badges3333 bronze badges
To list all packages intentionally installed (not as dependencies) by apt commands, run the following :
This provides a reverse time based view, with older commands listed first:
Installation data also showing synaptic usage, but without details(the same with installation date) :
providing the following:
bclbcl2,05511 gold badge88 silver badges22 bronze badges
Create a backup of what packages are currently installed:
Then (on another system) restore installations from that list:
To get rid of stale packages:
To get installed like at backup time (i.e. to install packages set by
wjandreadpkg --set-selections
):10.1k44 gold badges3232 silver badges7070 bronze badges
Ubuntu Software Downloads
gogamangogaman2,04511 gold badge99 silver badges33 bronze badges
man pages state:
will print a list of manually installed packages
So, it should just give a list of explicitly installed packages (though this includes packages that were part of the default initial install) without all of the dependencies included due to these packages being installed.
To output the result into a text file:
Pablo A4,12022 gold badges2020 silver badges4747 bronze badges
Tim TisdallTim Tisdall
dpkg-query
(instead of dpkg --get-selections
, which lists some packages that are not installed) as follows:Or:
d a i s y3,65688 gold badges2727 silver badges4848 bronze badges
kyleNkyleN
To list all installed packages,
or
or
Note:
You will get the result 1.txt file in your home folder or you can specify your own path.
d a i s yYou will get the result 1.txt file in your home folder or you can specify your own path.
3,65688 gold badges2727 silver badges4848 bronze badges
karthick87karthick8753.5k5656 gold badges174174 silver badges222222 bronze badges
You can use Synaptic to save the current state of your installed packaged. In Synaptic, select 'file/save markings', Enter the name of the file to save the state to, and make sure to check the 'Save full state, not only changes' box.
The file saved from this can be loaded into a new machine using 'file/read markings' in Synaptic.
NerdfestNerdfest3,37722 gold badges2424 silver badges2828 bronze badges
I recommend using blueprint. Even though it is designed for servers, it can be also used from desktops as well. It will create a shell script/chef/puppet that you ca use to re-install all you packages.
TamerTamer
You want to reinstall the packages now there on 12.04, right?
If so, it's very easy. You'll need an 'Ubuntu Single Sign On account.' (Create it before reinstalling so that your system is synced.)
- Go to the Software Center and look for the 'Sync Between Computers..' option under the File menu.
- When you click on it you will see your computer registered and a list of all apps on your computer.
- When you will install fresh, that computer will be considered a new computer.
- You just have to sign in to your Ubuntu account and your previous computer will be shown.
- Click on it; you'll get a list of all apps. Select 'install' on the app you want to install.
4,0581515 gold badges5151 silver badges8585 bronze badges
There's also a tool called Aptik (both command line and GUI) which can help you view a list of all installed packages, with an option to select/unselect some of them, make a backup list, and then restore the same set of packages in another system.
To install:
Further info: https://teejeetech.in/aptik/
As can be seen in the screenshot, Aptik lets you also backup and restore PPAs, which will certainly be necessary to install some of the packages installed.
SadiSadi9,16055 gold badges4141 silver badges5151 bronze badges
APT-Clone. This package can be used to clone/restore the packages on a apt based system.
- It will save/restore the packages, sources.list, keyring and automatic-installed states.
- It can also save/restore no longer downloadable packages using dpkg-repack.
source:
man apt-clone
APT-Clone is used by
ubiquity
(Ubuntu installer) for upgrade process. It is much better than the dpkg --get-selections
solution because:- It preserves all repositories information.
- It keeps track of what packages were automatically installed.
- It allows to repack locally installed DEB files.
How to Use
- Install
- Make backup
- Restore backupRestore to newer release:
It make simple gzipped tar file which can be easily edited and reviewed before restoring on the other machines. Here an example of its structure:
user.dzuser.dz36.3k1111 gold badges103103 silver badges187187 bronze badges
There's a great explanation on Unix StackExchange that describes how to use aptitude to list packages not installed as dependencies, and how to compare that list with the list of default packages for your Ubuntu release.
To obtain the manifest file for desktop versions of 12.04 and newer, visit this site, choose your release, and scroll down below the CD images to the files section. You'll find something like 'ubuntu-12.04.4-desktop-amd64+mac.manifest' that matches your architecture.
For server versions you'll need to obtain the manifest file from the ISO that was used to install the original system. For a VPS or cloud server, your provider may make the images available or you might need to contact them.
Here's an example using the code from the referenced post, along with modifications to install on the new server.
Old server (code from other post, output saved to file):
On the new server, copy the file using scp, then use sed to append 'install' to every line (-i performs an inline-replace). Then you can use the list as input to 'dpkg --set-selections' and install the packages with apt-get:
Before starting this task, I recommend reading and understanding all parts of the post mentioned in the beginning, and then consult the aptitude reference guide for details on search patterns.
thinkmassivethinkmassive
You can look at the
apt
log under /var/log/apt/
and the dpkg
log under /var/log/
and you can get the list of the installed packages with just a command:
MaythuxMaythux55.1k3535 gold badges187187 silver badges227227 bronze badges
I'm surprised the
apt-cache
command designed exactly for this purpose hasn't been mentioned above..For more info, run
apt-cache --help
:ostrokachostrokach
For the complete rundown see:
half way across the page:
dpkg --list
adriano72adriano72
The below command will also lists all the installed packages,
Avinash RajAvinash Raj55.4k4444 gold badges177177 silver badges227227 bronze badges
Help out this community wiki - Add up-to-date solutions.
dpkg, xargs, & apt-get
This command should accomplish the creation of a text file containing installed packages:
To accomplish the bulk installation of the listed packages you'll need to edit 'package_list.txt'. Remove the weird lines at the top of the file using a text editor. You can then use this command to install packages from the created file using:
apt-cache, xargs, & apt-get
Only use this method if you want all current packages to be installed using the list (which includes automatically installed, etc).
Output the response of 'apt-cache pkgnames' to a file we'll simply name 'package_list.txt'. You can accomplish this with:
Then when you want to install packages from 'package_list.txt' you would use this command:
apt-mark, xargs, & apt-get
We can use the command
apt-mark showmanual
to give a list of packages that were manually or initially installed with Ubuntu. We'll want to output that to a file we'll just call 'package-list.txt'. Use this command to accomplish that:The command we would use to install packages from the file 'package_list.txt' is below.
Aptik Migration Utility
Utility to simplify re-installation of software packages after upgrading/re-installing Ubuntu-based distributions.
[Launchpad | Aptik]
[Launchpad | Aptik]
For information on Aptik, try visiting its official page, and for a screenshot click here or view the end of this section.
Itunes for windows 8.1 64 bit. Installing Aptik is simple. Follow these steps:
- Add the PPA with:
sudo add-apt-repository -y ppa:teejee2008/ppa
- Update apt with the below command.
sudo apt-get update
- Install Aptik using:
sudo apt-get install aptik
To save a list of installed packages to a file named
wb9688wb9688installed_packages.txt
, just run:84211 gold badge1313 silver badges2626 bronze badges
I think it is interesting to note
apt list --installed
or dpkg-query --list
actually use the file called /var/lib/dpkg/status
in behind where all the info about the packages is beard.So if you would like to deal with the super extended list of packages just
cat /var/lib/dpkg/status
.Note: Do not alter
/var/lib/dpkg/status
file.prostiprosti
In addition to APT packages, many GUI packages are nowadays distributed as snaps.
If your package can't be found in
apt list --installed
, then try snap list
:It's also a good idea to add
/snap/bin
to the PATH so you can start those from the terminal (done automatically for non-root users).rustyxrustyx
The package
dctrl-tools
provide the grep-status
tool to get the list of the packages marked as installed on your system:Usage:
see :
man dctrl-tools
GAD3RGAD3R
https://www.rosehosting.com/blog/list-all-installed-packages-with-apt-on-ubuntu/:
To list the installed software packages on your machine you can use the following command:
The output of the command will be very similar to the following one, depending on which packages are currently installed:
To easily read the entire output you can use the
less
program.You can look for a specific package through the output using the
grep
program.The output from the above command will list all packages that include
apache
in their names.Apt supports patterns to match package names and options to list installed
(--installed)
packages, upgradeable (--upgradeable)
packages or all available (--all-versions)
package versions.Another alternative that you can use to list the installed software packages on your Ubuntu VPS is the
dpkg
command.The output of the command will provide you with information such as the name of the package, version, architecture and short description about the package. Of course, you can use the
grep
program again to search for a specific package.The output should look like the one below:
With the competition of this tutorial, you have successfully learned how to list installed packages in Ubuntu.
terdon♦74.5k1414 gold badges151151 silver badges235235 bronze badges
M.A.K. RiponM.A.K. Ripon1,51811 gold badge1212 silver badges2929 bronze badges
There are many ways to do that. In case you are using CentOS like me you can use these:1.
yum list installed
2. rpm -qa
saeed mohammadisaeed mohammadi
protected by Mitch♦Nov 5 '14 at 12:53
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged aptpackage-management or ask your own question.
Active9 months ago
I am beginner to Ubuntu. I have installed ubuntu desktop 14.04 and have tried to install PHP, Apache, MYSQL and PHPMYADMIN through terminal. I have tried many commands but have only installed Apache and php.
After some time i see that i have installed these software in many directories. So Now i want to see the list of All these software installed on my system and uninstall them and then install in a secure Way.
Muhammad TaqiMuhammad Taqi52022 gold badges88 silver badges2020 bronze badges
3 Answers
Open up a terminal and type,
to list all the installed packages.
To completely remove the package you want, type:
For example,
Also, the easiest way to install these services is using tasksel,
ztikztik
Open up Ubuntu software center. Go to
Installed
tab and in the search, simply type *
(asterick), the software center will show up all the installed software by category.To uninstall any software, simply highlight it and click Remove
.Ashraf AbusadaAshraf Abusada
To list all packages, type the following command in the terminal:
To remove package:
To remove package along with its configuration files if there is any:
Muhammad TaqiMuhammad Taqi52022 gold badges88 silver badges2020 bronze badges