How to see packages installed on a given date using aptitude

1

I have configured aptitude to write to a log (/var/log/aptitude). It produces output like this;

Aptitude 0.4.11.11: log report Mon, Feb 9 2009 13:21:28 +0100 IMPORTANT: this log only lists intended actions; actions which fail due to dpkg problems may not be completed. Will install 6 packages, and remove 0 packages. 4096B of disk space will be used =============================================================================== [UPGRADE] apt 0.7.20.1 -> 0.7.20.2 [UPGRADE] apt-utils 0.7.20.1 -> 0.7.20.2 [UPGRADE] base-passwd 3.5.19 -> 3.5.20 [UPGRADE] libgnutls26 2.4.2-5 -> 2.4.2-6 [UPGRADE] libpq5 8.3.5-1 -> 8.3.6-1 [UPGRADE] ucf 3.0015 -> 3.0016 =============================================================================== Log complete.

This shows the exact date and packages that aptitude installed. To configure this, follow the aptitude reference;

Option:Aptitude::Log Default:/var/log/aptitude Description: If this is set to a nonempty string, aptitude will log the...
0 0
2

by

Mikeage

Last Updated December 14, 2015 17:01 PM

Does anyone know if there's an easy way to find a list of packages installed, sorted by date, when using aptitude (or apt-get)?

I was installing a bunch of packages to try something new, and it didn't work out. I'd like to remove all of these packages, to get back some disk space.

I've tried just looking at the list of .deb files downloaded, but that seems like a rather backwards way of doing it (although it did work).

Answers 8

Unfortunately, dpkg (the package handler aptitude works on top of) does not specifically save the install date of packages, although there's thoughts of adding it. However, the install date can be found by looking at the date stamp of files written to the directory /var/lib/dpkg/info.

mok0
January 08, 2009 08:15 AM

I found this one here on the web. It creates a history of dpkg out of the dpkg log file.

It looks very simple.

...
0 0
3

Using aptitude, in order to look for installed packages outside of the stable branch, you can use:

aptitude search "?narrow(?installed,?not(?archive(stable)))"

To see versions as well as package-names (and instead of descriptions) you can use the command with the format option (-F for short), as follows.

aptitude search -F "%p %V %v" "?narrow(?installed,?not(?archive(stable)))"

For more formats, please take a look at the manpage (here's documentation with avail. options).

That works for example, in Debian if you installed packages outside Squeeze (by runing, for example, apt-get install -t sid package-name.

You can look where an installed package comes from via apt-cache policy, usage is as follows:

apt-cache policy

For example, my python-numpy package renders the following output:

$ LANG=C apt-cache policy python-numpy python-numpy: Installed: 1:1.6.2-1 Candidate: 1:1.6.2-1.2 Version table: 1:1.7.0-1 0 1...
0 0
4

##Package Installed

###Date There is a simple way to see all packages installation date. Go to:

cd /var/log Search for all dpkg.log, dpkg.log.1 by for example executing:

ls | grep 'dpkg.log'
and type:

cat /var/log/dpkg.log | cat /var/log/dpkg.log.1 | grep " install " (if you have more dpkg.log.x append them as well) As a result you will get nice list of all installed packages with exact date and time.

###All

To get a list of packages installed locally do this in your terminal:

dpkg --get-selections | grep -v deinstall To save that list to a text file called packages on your desktop do this in your terminal:

dpkg --get-selections | grep -v deinstall > ~/Desktop/packages (you don't need to run this as the superuser, so no sudo necessary here)

Ref...

0 0
5

RPM-based distributions like Red Hat are easy:

rpm -qa --last

On Debian and other dpkg-based distributions, your specific problem is easy too:

grep install /var/log/dpkg.log

Unless the log file has been rotated, in which case you should try:

grep install /var/log/dpkg.log /var/log/dpkg.log.1

In general, dpkg and apt don't seem to track the installation date, going by the lack of any such field in the dpkg-query man page.

And eventually old /var/log/dpkg.log.* files will be deleted by log rotation, so that way isn't guaranteed to give you the entire history of your system.

One suggestion that appears a few times (e.g. this thread) is to look at the /var/lib/dpkg/info directory. The files there suggest you might try something like:

ls -t /var/lib/dpkg/info/*.list | sed -e 's/\.list$//' | head -n 50

To answer your question about selections, here's a first pass.

build list of packages by dates

$ find /var/lib/dpkg/info -name "*.list"...
0 0
6

For Debian based systems like Ubuntu, you can use aptitude command for package management from the command line.

This article explains several aptitude command examples including the following:

Install a specific version of a package Install multiple packages using pattern Search for a package using pattern Get packages under a section Don’t update a specific package (Using hold and keep) Mark a package with a specific install type Perform system update Perform safe upgrade

1. Basic Package Install

Aptitude install is used to install packages along with its dependencies. For example, installing a package vim-gtk will also automatically install all the dependent packages.

# aptitude install vim-gtk The following NEW packages will be installed: libruby1.9.1{a} libyaml-0-2{a} tcl8.5{a} tcl8.5-lib{a} vim-gtk vim-gui-common{a} 0 packages upgraded, 6 newly installed, 0 to remove and 317 not upgraded. Need to get 6,360 kB of archives. After unpacking 19.0 MB...
0 0
7

This is a query that I frequently have: how to list packages sorted by their size? I am especially interested in this about installed packages. There are other tools that can do this job, but I like to use Aptitude for this since I use it regularly anyway.

To list all available packages:

Aptitude understands the concept of the install size i.e., how much disk space the files of a package occupy after they are uncompressed and extracted from the package. So, sorting by this installsize is easy:

Note that this listing is in ascending order of size. So, the largest packages are listed at the end.

The problem with this listing is that Aptitude does not display the size, so we have no idea how big the install sizes are. To show that, we can tinker with the display format and get it to display the package name and install size:

Using the shorter versions of the options, this command becomes:

Now, to list all installed packages:

Finally, to...

0 0
8

I am not sure if aptitude can do such a thing. But you can use:

apt-file show package_name

It will show all files which this package will install. If you would like to list all files which package contains, you can do it like this:

apt-file list package_name

It will list all the files located inside a package.

If you do not have installed apt-file then use:

apt-get install apt-file

and update the cache (it will take some time) by:

apt-file update


You can also to which package specific file belongs:

apt-file search file_name


You can also list files in a package on this website List files in package Or you can use dpkg -L package_name (but as you mentioned, it is working on already installed packages) as mentioned by...

0 0
9
I

am a new Ubuntu Linux sysadmin. How do I get a list of all installed packages on server1 and install those on server2? How to list all installed packages using apt-get command on Ubuntu or Debian server?


You need to use dpkg and other commands as follow to see a list of all installed packages on Ubuntu or Debian Linux server.

Just list all installed packages with a short description

Type the following command:
$ dpkg-query -l
Sample outputs:

Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=============================-=================================-============-============================================================================= == ii accountsservice 0.6.40-2ubuntu11.3 amd64 query and manipulate user account...
0 0
10

That particular error message may indicate that you have held packages, but it may also indicate a different problem.

You can get a list of actual held packages with:

dpkg --get-selections | grep hold

If there are none, or none look related, then it's probably something else. Check carefully the output of the command you were trying when you got the error message, as there may be other clues in the full output from that command, aside from the error message.

Another method of troubleshooting may be to use aptitude rather than apt-get to try to install your package:

sudo aptitude install

Aptitude will give up less easily, and will attempt to find solutions which may involve modifying other packages. It may give you more explanation of the problem and options for fixing it.

Occasionally aptitude will be too eager to remove or downgrade large numbers of packages to satisfy your request, in which case retrying with -f changes its priorities and helps...

0 0
11

If you are used to RPM-based Linux-distributions such as Red Hat and SUSE, it is quite a shock getting used to...

package management on Ubuntu Server. The most difficult part is the layered organization of Ubuntu package management services. Nevertheless, in many ways Ubuntu offers a much easier way to manage packages based on the Debian package format. Understanding how Ubuntu Package management works allows you to do your work as a Ubuntu Server administrator much more efficiently, and even update your system in one single command. In this article we'll explain how it works.

Ubuntu uses the same package management solutions as Debian. Package management on Ubuntu Server is based on a database that keeps track of all software packages that are installed. The most fundamental of all is the dpkg-database, which is based directly on the Debian package management utility. On top of that sits the apt database which is stored in /var/lib/apt. To manage packages in this...

0 0
12

I would like to have both apt-get and aptitude working properly on my Ubuntu 8.10 install. However, when I run the command apt- get install aptitude I get the following error:

Code:

root@lixx-xxx:~# apt-get install aptitude Reading package lists... Done Building dependency tree... Done Package aptitude is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package aptitude has no installation candidate root@lixx-xxx:~#

(Ubuntu 8.10 minimal install)

Can someone please provide a working example to help me have both tools installed properly?
Thank you.
...

0 0
13

Using aptitude for package management instead of apt-get, please note that it is bad practice to use aptitude and apt-get interchangeably, as they record separately the changes made by a user.

Open the Terminal from the Mint Menu and start with the commands:

sudo aptitude update && sudo aptitude install gtkorphan

The && is used to run the second command if the first command runs successfully.

Continue by running:

sudo aptitude update && sudo aptitude upgrade

This is used to double-check that you have all the updates.

To clear out the broken packages use the command:

sudo aptitude -f

It brings up a beautiful interface to search, navigate, install, update and otherwise to manage packages.

Use the commands on the screen to install all the updates. You may use the mouse or CTRL + T to open the menu. Also, you could use the arrow keys and the Enter key to navigate.

You can also install the Aptitude Package Manager if you...

0 0
14

The usual, or even classical way is to create the list of installed packages with sudo dpkg --get-selections > package_list, and then restore when/if necessary with cat package_list | xargs sudo apt-get -y install.

As VihangD points out in his serverfault answer, the same can be achieved with aptitude, while also excluding dependent, automatically installed packages (which are included by the classical method). To create the list of packages, run aptitude search -F '%p' '~i!~M' > package_list. Here, -F '%p' asks aptitude to only print package names (instead of the default output, which also contains package state and description); search term ‘~i!~M’ asks for all non-automatically installed packages.

To install packages using the created list, run xargs aptitude --schedule-only install . The first of these two commands instructs aptitude to mark all the packages from the list as scheduled for installation. The second command actually performs the...

0 0
15

apt-cache policy

$ apt-cache policy redis-server redis-server: Installed: (none) Candidate: 2:2.8.4-2 Version table: 2:2.8.4-2 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

apt-get install -s

$ apt-get install -s redis-server NOTE: This is only a simulation! apt-get needs root privileges for real execution. Keep also in mind that locking is deactivated, so don't depend on the relevance to the real current situation! Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libjemalloc1 redis-tools The following NEW packages will be installed: libjemalloc1 redis-server redis-tools 0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded. Inst libjemalloc1 (3.5.1-2 Ubuntu:14.04/trusty [amd64]) Inst redis-tools (2:2.8.4-2 Ubuntu:14.04/trusty [amd64]) Inst redis-server (2:2.8.4-2 Ubuntu:14.04/trusty [amd64]) Conf libjemalloc1 (3.5.1-2...
0 0
16

Aptitude is a front-end to the Advanced Packaging Tool (APT). It displays a list of software packages and allows the user to interactively pick packages to install or remove. It has an especially powerful search system utilizing flexible search patterns. It was initially created for Debian, but has appeared in RPM Package Manager (RPM) based distributions as well (such as Conectiva).
Aptitude is based on the ncurses computer terminal library, with which it provides an interface that incorporates some elements commonly seen in graphical user interfaces (GUIs) .
In addition to the ncurses interface, aptitude provides an extensive command-line interface (CLI). Even though aptitude is one executable file, it provides command-line functions similar to those of apt- family of tools (apt-get, apt-cache, apt-listchanges, etc.). Aptitude also emulates most apt-get command-line arguments, allowing it to act as a full replacement for apt-get. In the past, it was recommended that...

0 0
17

Error The following packages have unmet dependencies has plagued Ubuntu users for a while now, and there are more and more sightings of the error on various versions of Ubuntu. The APT package management system is easy to use, but in some occasions, such as when you’re mixing in third-party dependencies, you might get this error from apt-get.

This happens when you try to install something with the apt system via a terminal, and the installation fails with no obvious problem whatsoever. This issue isn’t limited to any one particular program, but it might happen with quite a few of them. This is because the issue lies in the apt system, and not in the program you’re installing.

There are fortunately quite a few solutions for this, some of which are easier to do, and others more difficult, but if you follow the instructions in the methods below, you will get rid of the error in no time.

Note: Before proceeding with any of the methods, it is advisable that you...

0 0
18

First, I need to make sure that everybody knows the difference between apt-get remove and apt-get purge.

apt-get remove — will remove the binaries but will keep the files associated with the package. Also, the dependencies remain untouched.

apt-get purge — will remove the binaries and all the files associated with them, but will leave the dependencies untouched.

None of the two commands do not delete the configuration files of the package, stored in your ~/.* .

If you want to remove a package completelly, use apt-get purge (or apt-get remove –purge, they are synonyms), if you want to keep files associated to the program, in order to reinstall it later and use them use apt-get remove.

But if use apt-get remove to uninstall packages, how do you get rid of the remaining files, (as apt-get purge would have done) ?

Use locate / find and delete them by hand? No.

You can use this aptitude trick (if you don’t have aptitude installed do...

0 0
19

> On Wed, May 11, 2016 at 6:58 PM, Bret Busby

[hidden email]

> wrote:

>> On 11/05/2016, Tom H

[hidden email]

> wrote:

>>> On Wed, May 11, 2016 at 2:05 PM, Bret Busby

[hidden email]

> wrote:

>>>> On 11/05/2016, Tom H

[hidden email]

> wrote:

>>>>> On Wed, May 11, 2016 at 12:47 PM, Ralf Mardorf

[hidden email]

>

>>>>> wrote:

>>>>>> On Wed, 11 May 2016 12:06:29 +0200, Tom H wrote:

>>>>>>>

>>>>>>> The best answer's the one that proposed an aptitude search because it

>>>>>>> returned the list of packages that were installed specifically rather

>>>>>>> than automatically.

>>>>>>

>>>>>> this isn't a good advice.

>>>>>>

>>>>>> A pitfall could be that some packages are installed with the

>>>>>> recommended packages, but others were not installed with recommended

>>>>>> packages. This is important even when installing the same Ubuntu

>>>>>>...

0 0
20

Sometimes, we may need to install programs on Ubuntu or Debian, but the installation may not be successful due to dependencies. It means the program won't be installed unless we install other programs to run normally.


If you want to exclude these dependencies and force install a program on Ubuntu or any other Debian-based system, then follow these instructions:

Open the Terminal and run one of these commands to force install a package:

sudo apt-get install --no-install-recommends package_name
or
sudo aptitude install --without-recommends package_name


Replace package_name with the name of the program you want to install. Using the second command, I managed to force install Mencoder and FFmpeg on Ubuntu 11.04.

Warning: Use these commands at your own risk! We are not liable for any damage that these commands may cause to your system.


Good...

0 0
21

In this article, I will show you how to list the number of package updates available for install from the command line on Linux systems. I have used following tools apt, apt-get, aptitude, yum, apt-check script and apticron to list updates.

Using apt command (above Ubuntu 14.04)

Since ubuntu 14.04 we have a new command called "apt". The following command will list out all the packages that you can update, what their current versions are, and what the new version is.

sudo apt list --upgradableListing... Done gnupg/stable 1.4.18-7+deb8u2 amd64 [upgradable from: 1.4.18-7+deb8u1] gpgv/stable 1.4.18-7+deb8u2 amd64 [upgradable from: 1.4.18-7+deb8u1] libgcrypt20/stable 1.6.3-2+deb8u2 amd64 [upgradable from: 1.6.3-2+deb8u1] libidn11/stable 1.29-1+deb8u2 amd64 [upgradable from: 1.29-1+deb8u1] linux-image-3.16.0-4-amd64/stable 3.16.36-1+deb8u1 amd64 [upgradable from: 3.16.7-ckt25-2+deb8u3]

Usually, this command should be run after apt update. If any update is it would...

0 0
22

Manage packages from the commandline

The more common way to manage packages or softwares is from Synaptic Package Manager. Its the easiest gui tool to install and remove software from your debian/ubuntu system.

However for those who prefer the console, there are plenty of tools to do the job as easily. In this tutorial we are going to look into apt, the package management tool used on ubuntu. Even I used to use the synaptic gui earlier, when I started with the commandline tools, I found the commandline tools easier and faster.

On ubuntu there are 3 main commands to manage packages. These are dpkg, apt-* and aptitude. So lets start experimenting with these one by one.

Dpkg command

List all installed packages

This command will list all the installed packages.

$ dpkg -l

Search installed packages

Search the installed packages for 'apache'

$ dpkg --get-selections | grep 'apache' apache2 install...
0 0
23

Oracle interview questions

What is Observer pattern ? Explain with Code Example ? view answer Replication Troubleshooting using DBMS_REFRESH: view answer How to work with Oracle Data Pump? view answer dbv: DBVERIFY utility in oracle: view answer Physical Standby Database Creation in Oracle view answer Working with AWR - Oracle 10g for Performance tuning in Oracle view answer DBMS_SCHEDULER in Detail: view answer How to manually Create Oracle DataBase: view answer How to create Oracle Database Version: 10.2.0.1.0 in Linux: view answer Change DB Name in Oracle: view answer ORA-06502: PL/SQL: numeric or value error in Database Version: 10.2.0.3 view answer Subtracting values in PL/SQL and merging result into cursor or table ----------------------- I am trying to pull in values from two different dates on a table (start and end) and subtract one from the other and store it into my result set which I'll be passing back via a cursor with my PL/SQL procedure. I'm a...
0 0
24

I recently purchased that most marvelous of devices the Raspberry Pi and naturally my thoughts turned to the nefarious given its cheap price and small package. I decided to attempt to create a man-in-the-middle device that could be discreetly attached to a remote network and could redirect and sniff traffic. I’m only a very novice Linux user so it took a bit of learning to wrangle man pages as well as some intrepid Google-fu, but I’m going to document how I was able to turn this tiny device into an evil packet-sniffing machine.

For those who don’t know, a man-in-the-middle attack involves secretly becoming an intermediary between the communication between two parties; each thinks they are talking to the other when in fact they are both talking to the attacker. The attacker can choose to pass the information along unmodified (simply observing the communication) or may choose to modify parts of the communication for the own evil ends. The Wikipedia article gives examples and...

0 0
25

Preface

Note: I changed jobs a couple of years ago, and I no longer have access to a Citrix Server, therefore these instructions are to the best of what I had at the time, and may have changed or require tweaking since the last time I executed them.

Fortunately for us Linux users, Citrix provides binaries for connecting to Citrix servers from Linux boxen. Unfortunately, they have made the attempt to oversimplify the installation of their binaries by providing an installation script. The installation script is flawed in that it assumes you want to use Netscape as your browser. And even then it doesn t seem to install ready-to-use. So for those of us that want to use it with a different browser (and/or Netscape for that matter), we are relegated to hunting google and/or searching for hidden documentation on how to manually install the client. So to Citrix, I say "A for effort" and "F" for not realizing that us linux techies also like to have...

0 0