Software Management

    APT / dpkg

    sudo apt list --installed <package-name-start*>
    
    sudo apt --reinstall install <package>
    
    dpkg --list | grep <package-name-fragment>
    
    sudo apt update
    sudo apt upgrade
    

    less /var/log/apt/history.log

    These logs gets rotated (every month I guess), old files will be suffixed with a number and compressed. So to view the next history log, use:

    zless /var/log/apt/history.log.1.gz

    To view the logs available:

    ls -la /var/log/apt/

    from here

    Desktop applications

    • ends in .desktop
    • found in /usr/share/applications

    Desktop icons

    • svg and png typically
    • found in /usr/share/icons

    search path

    .bashrc holds path variables.

    Upgrade Distro

    Based on this link

    1. Might as well be fully updated first

      sudo apt update
      sudo apt upgrade
      sudo shutdown -r now
      
    2. edit which upgrade you want to do (lts or normal)

      sudo nano /etc/update-manager/release-upgrades
      

      change prompt=lts to prompt=normal

    3. run updater

      do-release-upgrade
      

      you may need to indicate what to do with specific config files that get updated.

    4. Restart

      sudo shutdown -r now
      

    Package Management

    List repositories

    apt policy
    

    Remove a repository

    sudo add-apt-repository --remove ppa:PPA_Name/ppa
    

    Show all manually-installed packages

    apt-mark showmanual
    

    Duplicate Installed Packages

    To clone your system to another system. Or make a backup. In a terminal type:

    dpkg --get-selections | grep -v deinstall > ubuntu-files
    

    This command makes a file list of all installed packages in your system (and stores it in present working directory). Backup this file in hdd, email, etc…(this file is very small).

    In the freshly installed ubuntu system run:

    sudo dpkg --set-selections <./ubuntu-files (will set it up and)
    apt -y update
    apt dselect-upgrade
    

    This will install only those packages you had installed (with apt) in the old system.

                                    (OR)
    

    You could back up all the .deb packages from /var/cache/apt/archives/ and install them manually using:

    dpkg -i *.deb
    

    And after that running an update cycle later.

    Identifying packages installed via logs

    first step is to find the first line number where a particular date occurs

    cat /var/log/apt/term.log | grep -n 08-15
    

    do that again to find the beginning of the second date range if necessary

    cat /var/log/apt/term.log | grep -n 08-16
    

    Then use this technique to select only part of the log and then identify newly added packages

    sed '915,10000000!d' /var/log/apt/term.log | grep -i "selecting previously unselected"
    

    this returns something like

    Selecting previously unselected package libglfw3:amd64.
    Selecting previously unselected package libgl1-mesa-glx:amd64.
    Selecting previously unselected package libosmesa6:amd64.
    Selecting previously unselected package xorg-sgml-doctools.
    Selecting previously unselected package x11proto-dev.
    Selecting previously unselected package libxau-dev:amd64.
    Selecting previously unselected package libxdmcp-dev:amd64.
    Selecting previously unselected package xtrans-dev.
    Selecting previously unselected package libpthread-stubs0-dev:amd64.
    Selecting previously unselected package libxcb1-dev:amd64.
    Selecting previously unselected package libx11-dev:amd64.
    Selecting previously unselected package libglx-dev:amd64.
    Selecting previously unselected package libgl-dev:amd64.
    Selecting previously unselected package libegl-dev:amd64.
    Selecting previously unselected package libegl1-mesa:amd64.
    Selecting previously unselected package libglvnd-core-dev:amd64.
    Selecting previously unselected package libgles1:amd64.
    Selecting previously unselected package libgles-dev:amd64.
    Selecting previously unselected package libopengl-dev:amd64.
    Selecting previously unselected package libglvnd-dev:amd64.
    Selecting previously unselected package libegl1-mesa-dev:amd64.
    Selecting previously unselected package libosmesa6-dev:amd64.
    Selecting previously unselected package libglu1-mesa-dev:amd64.
    Selecting previously unselected package libglew-dev:amd64
    

    by doing a quick find/replace you can then clean up the list and do a sudo apt remove

    sudo apt remove libglfw3:amd64 libgl1-mesa-glx:amd64 libosmesa6:amd64 xorg-sgml-doctools x11proto-dev libxau-dev:amd64 libxdmcp-dev:amd64 xtrans-dev libpthread-stubs0-dev:amd64 libxcb1-dev:amd64 libx11-dev:amd64 libglx-dev:amd64 libgl-dev:amd64 libegl-dev:amd64 libegl1-mesa:amd64 libglvnd-core-dev:amd64 libgles1:amd64 libgles-dev:amd64 libopengl-dev:amd64 libglvnd-dev:amd64 libegl1-mesa-dev:amd64 libosmesa6-dev:amd64 libglu1-mesa-dev:amd64 libglew-dev:amd64