How to find manually installed packages?

1

I didn't see any solutions here work for me, I have installed quite a few deb packages with dpkg and a few of the items I was particularly looking for were missing.

A rather lengthy one liner, but convenient to copy and paste would be:

export DPKG_INITIAL=$(mktemp) DPKG_INSTALLED=$(mktemp) DPKG_CUSTOM=$(mktemp) DPKG_DEPS=$(mktemp) zgrep -E '^Package' /var/log/installer/initial-status.gz | awk '{ print $2 }' > $DPKG_INITIAL ; awk '$3 !~ /install|remove|purge/ { next } { gsub(/remove|purge/, "uninstall", $3) ; gsub(/:.+/, "", $4) ; a[$4]=$3 } END { for (p in a) { if (a[p] == "install") { print p } } }' /var/log/dpkg.log | sort -u > $DPKG_INSTALLED ; comm -23 installed initial > $DPKG_CUSTOM ; function rdep() { apt-cache rdepends $1 | tail -n +3 | sed -e 's/^ //' -e '/^ /d' | cut -d':' -f1 | sort -u; } ; echo "$(for i in $(cat custom) ; do rdep $i ; done)" | sort -u > $DPKG_DEPS ; comm -23 custom deps > my-packages ; rm $DPKG_INITIAL $DPKG_INSTALLED $DPKG_CUSTOM $DPKG_DEPS...
0 0
2

I installed a plain Ubuntu 10.10 on my computer and installed some software via apt-get. Last week I managed to break everything and just started from scratch, and I need to reinstall my software. Is there some way to create a list with all the packages that I have installed manually?

So that it would give me a list like texlive, ... and not texlive, texlive-dep1, textlive-dep2, ... and all the standard packages removed?

If I could somehow figure out which programs out of the regular install I have removed, that would be awesome too!

Update 2015-05-23: I now use Ansible as configuration management on my systems. There I specify the packages to install. This serves the goal, installing all the programs on a fresh system, even better. So this question might be the entry into some light configuration management.

With this suggestion, I'm assuming your old installation will still boot!

To replicate one set of packages on another machine:

On...

0 0
3

Search for packages that are manually installed, and that are a mandatory or recommended dependency of an installed package. Aptitude can do that.

aptitude search -q -F %p '?installed !?automatic (?reverse-depends(?installed .*) | ?reverse-recommends(?installed .*))'

I don't think there's a way to indicate what dependency was found for each package. If you want that information, Python would be the way to go. This very quick-and-dirty script seems to do it (mostly, I think it may be incorrect in some non-straightforward cases involving disjunctions, version dependencies, pre-depends, …).

#!/usr/bin/env python2 import apt packages = apt.Cache() covered = {} # Inverse dependency computation: for each installed package, record which # packages require it (as Depends: or Recommends:). for p in packages: if p.installed: for l in p.installed.dependencies + p.installed.recommends: for d in l: if packages.has_key(d.name) and packages[d.name].installed: ...
0 0
4

CentOS ships with “yum”, which is the default package manager for RHEL based systems. Like other package managers for distros such as Ubuntu, it allows you to easily add, remove, and update software on your Linux distro. It also takes care of dependencies. So for example, if you install package “A” that requires “B” and “C” to function, yum will automatically install “B” and “C” for you without you needing to worry about doing so manually.

This works great – except for one problem. Yum doesn’t really make a distinction between packages that were installed manually and those that were installed automatically as dependencies. This can lead to problems when you’re trying to see what you installed on your system manually. In an OS like Windows, the “Add/Remove Programs” shows you what you’ve installed. Yum has no similar feature. It’s important because if you’re setting up a new server, you might want to know what packages to install manually in order to replicate your current...

0 0
5

There are a few ways, most are similar to this :

You can download the package, unzip or decompress, go to that folder and run: apm link that will create a symbolic link from that package to your ~/.atom/packages folder.

But ensure that you install all dependencies require by the package also, as if you dont have internet connection then you may encounter issues.

There some good information here i will quote for your convenience that outlines how to handle this :

When you manually download and extract the zip file you need to run apm install in the package's directory afterwards to pull in any dependencies. This will download all dependencies and place them in the node_modules folder and recursively pulls in their dependencies as well. Since this is not possible in your environment, you'll have to do that manually.

Recursively go over each package.json file. If it lists a package as a dependency search on npm6 for the package and follow...

0 0
6
#!/usr/bin/env python
# See https://github.com/SmartFinn/eve-ng-integration

from __future__ import print_function
from subprocess import Popen, PIPE

import os
import sys

class Terminal(object):
def __init__(self):
self.current_desktop = os.getenv('XDG_CURRENT_DESKTOP')
self.override_terminal = os.getenv('OVERRIDE_TERMINAL_CMD')

def _is_command(self, command):
for path in os.getenv('PATH', '').split(':'):
if os.path.exists(os.path.join(path, command)) and \
os.access(os.path.join(path, command), os.X_OK):
return True
return False

def _current_desktop(self, *desktops):
if self.current_desktop is not None:
current = self.current_desktop.lower()
for desktop in desktops:
if desktop in current:
return True
return False

def _terminal_emulator_cmd(self):
if...

0 0
7

Another way to do this is by determining what has been installed based on your "tasks" which determine the base packages to install according to your initial needs.

tasksel --list-tasks

At the very least you'd have server. However, you may choose to have more. For each of those tasks you have installed, you can get a list of packages that are installed the following command does it all in one line (broken down for clarity) for the ones I have chosen in my installation:

(tasksel --task-packages server ; \ tasksel --task-packages openssh-server ; \ tasksel --task-packages lamp-server) | sort | uniq

A generic approach to the above would be:

(for a in $( tasksel --list-tasks | grep "^i" | awk '{ print $2 }' ) ; \ do tasksel --task-packages $a; done) | sort | uniq

Now use apt-cache depends --installed -i --recurse | grep -v "^ " to get a list of dependencies used by all the packages defined in the task. This can be done in one line as follows

apt-cache depends...
0 0
8
Aptitude

(an APT front-end) has long been able to distinguish between packages as being automatically installed (based on some dependancy that another package required) or "manually" installed. Since Debian Lenny (5.0) this capability is integrated into the

APT package management system

and most probably Aptitude's functionality got a lot thinner (since it doesn't have to implement something that's already in APT's core).

I could not find a method to do this (ie. list the manual/auto installed status of packages) the APT-way, but Aptitude's

search

function does it well enough.

Here's the command to list automatically installed packages:

aptitude search '.*' | grep '^i.A' | less

And the trivial opposite (list of manually installed packages):

aptitude search '.*' | grep '^i.[^A]' | less

In more recent APT versions

apt-cache

has a

showauto

parameter which lists automatically installed packages. Doing the reverse...

0 0
9

After getting PEAR working on your machine (see Installation) you most likely want to install some packages. This guide shows people new to the PEAR command line installer how to get started.

The general command to install a PEAR package named "foo" is

$ pear install foo

Typing this and pressing return, the package will be downloaded and installed on your computer. It does not matter if you write the package name in lowercase, UPPERCASE or MixedCase - the installer will find the package by lowercasing the name.

When a package is already installed, you will get the following message:

$ pear install foo Ignoring installed package pear/foo Nothing to install

This happens even if there is a newer version of the package! The correct command to upgrade to the lastest version is

$ pear upgrade foo upgrade ok: channel://pear.php.net/Foo-1.2.3

If the package already has the lastest version, you will get a message similar to the...

0 0
10

Have you already discovered the command sudo dnf history? You can use it to access a database with all previous transaction. Each transaction has an ID number (first column).

The history command knows the following sub-commands: list, info, redo, undo, rollback, userinstalled

Now, you can get a list of all user-installed packages.: sudo dnf history userinstalled.

You can also list all changes of a transaction: sudo dnf history list , ie sudo dnf history list 1,

or get more info about the packages of a certain transaction:sudo dnf history info , ie sudo dnf history info 4

To undo a complete transaction, you do: sudo dnf history undo .

For more details about dnf type man dnf or dnf --help in your terminal. There is plenty more you can do with...

0 0
11

To compile something, I needed the zlib1g-dev package to be installed so I launched an apt-get install zlib1g-dev.

apt-get informed me nicely that the package was already auto-installed because of an other package, and that it understands that I want it installed explicitly now :

# apt-get install zlib1g-dev zlib1g-dev is already the newest version. zlib1g-dev set to manually installed.

My compilation done, I don't need it any more explicitly, so I want to revert its status to the previous one : auto-installed. This way it will be pruned automatically when it will not be needed any more with a simple apt-get autoremove.

I cannot do an apt-get remove zlib1g-dev since some packages still depends on it.

So how may I revert the package zlib1g-devinstallation state to auto-installed ?

I know that I might edit /var/lib/apt/extended_states by hand from

Package: zlib1g-dev Auto-Installed: 0

to

Package: zlib1g-dev Auto-Installed: 1

... but it...

0 0
12
H

ow do I find and list installed Debian or Ubuntu Linux packages date? How can I see when packages got updated on my systems?


Debian or Ubuntu Linux log package status changes and actions to a file. The default is /var/log/dpkg.log file. This file has log message in the following format:

Log messages are of the form `YYYY-MM-DD HH:MM:SS status state pkg installed-version’ for status change updates; `YYYY-MM-DD HH:MM:SS action pkg installed-version available-version’ for actions where action is one of install, upgrade, remove, purge; and `YYYY-MM-DD HH:MM:SS conffile filename decision’ for conffile changes where decision is either install or keep.

List packages by installation date

Simply type the following command to see the last packages info:
# tail -f /var/log/dpkg.log
Sample outputs:

2016-01-14 13:20:50 status installed man-db:amd64 2.6.7.1-1ubuntu1 2016-01-14 13:20:50 trigproc libc-bin:amd64 2.19-0ubuntu6.6 2016-01-14...
0 0
13
...
0 0