I need to use a command and or script that uninstalls the last recently installed application deb . I can’t use apt-get in this case but rather dpkg –purge or similar, something like dpkg –remove (last recently installed application) but without providing the name of the application.
thanks
ls -tl /var/lib/dpkg/info/*.list : gives you the list of package sorted by date
head -n 1 : gives you the first item
awk ‘{print $8}’ : gives you the fullpath filename
xargs -n1 basename : gives the filename , like curl.list
sed -e “s/.list//” | gives you the package name