Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: List user installed software

  1. #1
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    60
    Distro
    Ubuntu

    List user installed software

    When preparing to migrate from one OS installation to another I print lists of installed packages.
    These can be saved to text files to reference when installing software to a new OS.
    In the newly installed OS software items can then be ticked off a list.

    Commands like...
    snap list
    flatpak list
    ...do these respective parts of the job neatly.

    For packages installed via apt I don't know how this might be done.
    Sure, I can search packages...
    apt list --installed | grep package_name
    ...but that will only pull up packages one at a time.
    And it provides no reminder of installed packages that do not spring to mind.

    I am particularly interested in finding a way to print a list of packages that appear in Show Applications.
    They are usually the ones I care about the most.
    Is there any way of creating a list of them?

  2. #2
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,790

    Re: List user installed software

    You can simply list all installed packages and run that list on a new machine. Packages that are already installed will be skipped.

  3. #3
    Join Date
    Aug 2020
    Beans
    9

    Re: List user installed software

    The applications that show up in GNOME's "Show Applications" menu all have .desktop files in /usr/share/applications or ~/.local/share/applications.

    Code:
    dpkg --search '*.desktop' | awk '{print $1}' | sed "s/://" | sort --unique
    would list all of their package names, including pre-installed programs.

    Source: https://askubuntu.com/questions/1091...-which-has-gui
    Last edited by cg-152; August 26th, 2020 at 04:04 AM.

  4. #4
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    60
    Distro
    Ubuntu

    Re: List user installed software

    Quote Originally Posted by cg-152 View Post
    The applications that show up in GNOME's "Show Applications" menu all have .desktop files in /usr/share/applications or ~/.local/share/applications.

    Code:
    dpkg --search '*.desktop' | awk '{print $1}' | sed "s/://" | sort --unique
    would list all of their package names, including pre-installed programs.
    Thank you. This produces a list that is close enough to what I was looking for.
    The output includes results that are of no interest but I think all the ones I am interested in are there too.
    Quote Originally Posted by HermanAB View Post
    You can simply list all installed packages and run that list on a new machine. Packages that are already installed will be skipped.
    That's very interesting.
    How is it done? Do you have a link to a page where the method is described?

  5. #5
    Join Date
    Dec 2014
    Beans
    2,578

    Re: List user installed software

    Code:
    apt-mark showmanual
    produces a list of all installed packages that have been recorded as 'manually installed'. This list also includes everything installed during the original installation of Ubuntu (the installer sets that attribute so removing some pre-installed software won't break the system). Removing those packages from that list can be done, provided you still have the logs the installer left behind in /var/log/installer. There should be a file /var/log/installer/initial-status.gz. This contains a gzipped detailed list of the packages installed. You can reduce that to a simple list of packages with
    Code:
    sudo zcat /var/log/installer/initial-status.gz | sed -n '/^Package: / s/^Package: //p'
    The 'sudo' is necessary because the log-file is only accessible for root. Combine the two lists into one , sort it and write out just the packages which are in the list only once
    Code:
    (apt-mark showmanual;sudo zcat /var/log/installer/initial-status.gz | sed -n '/^Package: / s/^Package: //p')|sort|uniq -u > ~/packages.list
    You should now have a text file named packages.list in your $HOME with all manually installed packages but without the ones from the original installation. Using that list to install those packages should be as simple as 'xargs -a packages.list sudo apt install'

    Holger

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: List user installed software

    If upgrading, you may want to edit it to remove obsolete, old kernels or others. It will not re-install anything already installed.
    https://help.ubuntu.com/community/Re...ngSamePackages
    from lovinglinux - use dpkg to list installed apps
    http://ubuntuforums.org/showpost.php...75&postcount=5

    From old install
    dpkg --get-selections > ~/my-packages
    From New install
    sudo dpkg --set-selections < my-packages
    sudo apt-get -y update
    sudo apt-get dselect-upgrade
    #IF you get this error:
    dpkg: warning: package not in database
    sudo apt-get install dselect
    sudo dselect
    -> Update
    -> Install
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #7
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,790

    Re: List user installed software

    Ayup, with this kind of thing, it pays to read the dpkg and apt man pages...

  8. #8
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    60
    Distro
    Ubuntu

    Re: List user installed software

    Yesterday I installed 20.04.1 Focal to a new partition on my boot drive.
    After the install I ran...
    sudo apt update
    sudo apt upgrade
    ...to get the system up to date.
    Then I added packages to my preference. One at a time from listed notes recorded from a recent good 18.04.5 Bionic installation.

    I tested Holger's commands on the new Focal install.

    Quote Originally Posted by Holger_Gehrke View Post
    Code:
    apt-mark showmanual
    This produced an output with 68 lines. It's easy for me to see the things I've added there.

    I checked /var/log/installer.
    Code:
    zen@gnuzen:~$ cd /var/log/installer
    zen@gnuzen:/var/log/installer$ ls
    casper.log  initial-status.gz  partman  telemetry
    debug       media-info         syslog   version
    Log file is still there.
    I tried your suggested command:
    Code:
    (apt-mark showmanual;sudo zcat /var/log/installer/initial-status.gz | sed -n '/^Package: / s/^Package: //p')|sort|uniq -u > ~/packages.list
    Its output file packages.list had 1552 lines. It contained many items that I had not added. But who knows what was updated right after the vanilla install. That update downloaded about 150MB.

    To test your suggested install command 'xargs -a packages.list sudo apt install' I would need to create a new install of Focal. Not impossible, but I don't want to do it right at the moment.
    Quote Originally Posted by oldfred View Post
    If upgrading, you may want to edit it to remove obsolete, old kernels or others. It will not re-install anything already installed.
    https://help.ubuntu.com/community/Re...ngSamePackages
    from lovinglinux - use dpkg to list installed apps
    http://ubuntuforums.org/showpost.php...75&postcount=5

    From old install
    dpkg --get-selections > ~/my-packages
    From New install
    sudo dpkg --set-selections < my-packages
    sudo apt-get -y update
    sudo apt-get dselect-upgrade
    #IF you get this error:
    dpkg: warning: package not in database
    sudo apt-get install dselect
    sudo dselect
    -> Update
    -> Install
    As a test I ran...
    Code:
    zen@gnuzen:~$ dpkg --get-selections > /media/zen/DG-1gb/dpkg-selections-dg
    ...which saved output to a USB stick. Output has 1882 lines, so ~300 more than Holger's command output.

    This looks like a reliable method. I will certainly try it out.
    Thanks for posting it, oldfred. If the process works cleanly it will save lots of time.

    Thank you all for your responses.
    Although I'm yet to test your suggestions my query has been comprehensively addressed.
    Hence marked solved.

    Cheers,
    nought2

  9. #9
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: List user installed software

    I might compare the two files to see differences.
    I have found old kernels and some software I did not want anymore in list, so just manually delete that line. It is just a text file.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  10. #10
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    60
    Distro
    Ubuntu

    Re: List user installed software

    Quote Originally Posted by oldfred View Post
    I might compare the two files to see differences.
    With >1500 lines in each text file it is difficult to compare them manually.

    Can that sorting be done via terminal?

    Anyhow, in this instance the files were produced from same OS only minutes apart.
    The different commands must be finding different things.

    Agreed, a human visual scan would be worthwhile.
    As long as the human knew the type of things to look out for.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •