Score:-1

I want to list Install and Upgrade package list with date and repo name

mn flag

I want to list Install and Upgrade package list with date and repo nam.

I have multiple repo in my server some i want scan and list daily what are package install and when it installed and which repo used for it. any help please .

what i required here i did in RHEL by using below the commands, same like i need in Ubuntu could you please some one help here.

repoquery -a --installed --qf "%{ui_from_repo} | %{name} | %{release} | %{INSTALLTIME}" | grep '^@MY_REPONAME' |  awk -F "|" '{print strftime("%Y-%m-%d", $4)}' | sort -t '|' -k1  | tail -1`

Sample output.

Packagename | Repo_Name | Installed_date

Score:0
cn flag

The apt and dpkg databases on your Ubuntu system do not keep track of dates. Debian-based systems therefore do not have a comparable apt command.

The information is on your system in your apt logs (/var/log/apt/). You must build a script to parse those logs and present the data in your preferred output format.

Please remember to share your script with others, so they can use it, too.

Bandhala Raja S avatar
mn flag
Thanks for the update ! i Build the script and it working. will keep post on here.
Score:0
mn flag

Here is the answer of my question, We need to work some tricky type of action.

Step-1 : Collect Installed and Update package based on the date.

for x in $(ls -1t /var/log/dpkg.log*);do zcat -f $x |tac |grep -e " install " -e " upgrade "; done | awk -F ":a" '{print $1 " :a" $2}' | column -t | awk '{print $1" "$2" "$4" "$7}' | grep -i "2021-12-18" > /tmp/pkg.list

Step-2: Do some loop to get repo name based on the package name which we copied /tmp/pkg.list file .

cat /tmp/pkg.list | while read a b c d ; do repo=`apt-cache showpkg $c | grep $d | head -1 | awk '{print $2}' | sed -r 's/(\(|\))//g'`; echo $a $b $c $d $repo;done
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.