Page 11 of 14 FirstFirst ... 910111213 ... LastLast
Results 101 to 110 of 132

Thread: HowTo: Create a list of installed packages

  1. #101
    Join Date
    Jul 2007
    Beans
    21

    Re: HowTo: Create a list of installed packages

    Great comment. I will install ALL the things! Muahaha!!!

  2. #102
    Join Date
    Feb 2007
    Location
    The Netherlands
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: HowTo: Create a list of installed packages

    FTFY

    📻 Amp.lol. No bloat, just radio. 🤘

  3. #103
    Join Date
    Dec 2010
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Create a list of installed packages

    I wasn't interested in listing all of the dependencies, but just the top packages, for which all the others would be installed automatically.
    Here's my script:

    Code:
    dpkg --get-selections > installed-software
    touch top_dependents # create file to list top dependents
    while read PAK # read installed-software file, line-by-line
    do
               if [ "$(apt-cache rdepends $PAK | tail -1)" != "Reverse Depends:" ] # is the reverse depends (i.e. dependents) list empty? (can also be implemented using sed instead of tail)
               then echo "$PAK has dependents" # user feedback. can be commented out
               else
                          echo "$PAK is top dependent" # user feedback. can be commented out
                          echo $PAK >> top_dependents # append to top dependents list
    fi
    done < installed-software
    Hope others make use of this. Feel free to tweak!

  4. #104
    Join Date
    Jan 2012
    Beans
    1

    Re: HowTo: Create a list of installed packages

    wow, thanks for the script. it's very useful

  5. #105
    Join Date
    Dec 2010
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Create a list of installed packages

    CAUTION: If I have a package A installed which has some other package B dependent on it, but I did not install package B, the script might not show A as a top package (since the repositories will have package B listed as dependent on A). This means that the output of my script will not include any such package as A, and there may be MANY such packages.

    Can anyone offer a way to have the script go only over packages installed localy, rather than checking dependencies on the repository?

    Quote Originally Posted by InonS View Post
    I wasn't interested in listing all of the dependencies, but just the top packages, for which all the others would be installed automatically.
    Here's my script:

    Code:
    dpkg --get-selections > installed-software
    touch top_dependents # create file to list top dependents
    while read PAK # read installed-software file, line-by-line
    do
               if [ "$(apt-cache rdepends $PAK | tail -1)" != "Reverse Depends:" ] # is the reverse depends (i.e. dependents) list empty? (can also be implemented using sed instead of tail)
               then echo "$PAK has dependents" # user feedback. can be commented out
               else
                          echo "$PAK is top dependent" # user feedback. can be commented out
                          echo $PAK >> top_dependents # append to top dependents list
    fi
    done < installed-software
    Hope others make use of this. Feel free to tweak!

  6. #106
    Join Date
    Dec 2010
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HowTo: Create a list of installed packages

    Fixed: add " --installed " after the apt-cache command to limit the search to packages currently installed (as opposed to packages which exist in the repos but are not currently installed).

    Quote Originally Posted by InonS View Post
    CAUTION: If I have a package A installed which has some other package B dependent on it, but I did not install package B, the script might not show A as a top package (since the repositories will have package B listed as dependent on A). This means that the output of my script will not include any such package as A, and there may be MANY such packages.

    Can anyone offer a way to have the script go only over packages installed localy, rather than checking dependencies on the repository?

  7. #107
    Join Date
    Feb 2012
    Beans
    25

    Re: HowTo: Create a list of installed packages

    I have a list of packages that I want to remove. what is the command to remove all packages within a text list?

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

    Re: HowTo: Create a list of installed packages

    this is a way to install:

    cat list-of-packages.txt | xargs sudo apt-get install -y
    cat package-list': you're printing the contents of the file package-list to the standard output
    ' | ': this is a pipe, it sends the standard output from the previous command to the standard input of the next.
    'xargs sudo apt-get install ': xargs takes the standard input, and adds it on to the following command (sudo apt-get install) as arguments.

    If you change install to remove or purge it should work. Have not tried it. See also:
    man apt-get
    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.

  9. #109
    Join Date
    Dec 2007
    Beans
    8

    Re: HowTo: Create a list of installed packages

    You can reach this article also via this short address:
    http://tinyurl.com/8yjrfpf

    How to create a list of installed packages - revision 2012.

    Quote Originally Posted by Cynical View Post
    (...)
    dpkg --get-selections > installed-software
    (...)

    And if you wanted to use the list to reinstall this software on a fresh ubuntu setup (...)

    dpkg --set-selections < installed-software

    followed by
    (...)
    dselect
    Thank you, Cynical , for your advise written in 2006. Recently, I tried this out with Kubuntu 12.04 LTS. Now, in 2012, your approach still works quite well: also for *Ubuntu 12.04 LTS. However, a few details are slightly different -eg. the package dpkg only works now with super user privilege. That's why I summarise here how I do it today.

    Start at the PC which has a *Ubuntu configuration you like. Open a terminal there and give in the following command:

    Code:
    sudo dpkg --get-selections > installed-software
    ..for generating a list of packages at an existing system.

    Than, copy the list to the home directory at another configuration: the same computer after a fresh install or another computer at which you want to copy the configuration of the PC where you have generated the list.

    There, open a terminal at the PC where you want to install the packages from the list. First install the package "dselect" if it's not already there:

    Code:
    sudo apt-get install dselect.
    Stay in the terminal and give in the following command:

    Code:
    sudo dpkg --set-selections < installed-software
    Then, stay in the same command line and give in this command:

    Code:
    sudo dselect
    And choose for option 3: "install and upgrade wanted software".
    It might take a few hours before all the packages will be installed - however, everything will work automatically from this point on.

    Finally, I share with you a few points of attention.

    In my opinion, this method is only safe when working with the same version of the same distro at the "old" and "new"configuration: eg. from Kubuntu 12.04 LTS to Kubuntu 12.04 LTS.

    However, it is an excellent method to save a lot of time in case you want exactly the same software configuration in a fresh install at the same or another computer. Eg. at my main computer, I upgraded from Kubuntu 11.10 to 12.04 about one month ago. However, the system symply did not work smoothly - it kept crashing several times per day. So,I backed up my data to an external HD and my software configuration to the file "installed-packages". Afterwords, I carried out a fresh install of the same distro and version at the main computer. Via "installed-packages"I regenerated the configuration I want. Now, everything seems to work well again .

    In case you would like to start working with a next version of your distro, act as follows:
    1. backup all your data;
    2. upgrade the existing configuration;
    3. generate a.s.a.p. the list of installed packages and backup also that file at a external HD.
    3. use this list in case of a fresh install.
    About two times per year I carry out a fresh install at both of my computers - with a view to maintaining a well-functioning configuration.

    If you want "ttf-mscorefonts-installer": install it first via a graphical package manager.
    A nasty detail is the package "ttf-mscorefonts-installer": the package for "microsoft" fonts like Verdana, Arial, etc. If you want this in your system, install it via graphical package manager - only in this way you can indicate accepting the conditions you need to accept in order to be able to install it. !! Please do so before working with the list of installed packages - as summarised above!! Otherwise, the installation process will stagnate somewhere half way. If this happens, give in the following command:
    Code:
    sudo apt-get purge ttf-mscorefonts-installer
    After doing so, the installation process will resume and smoothly come to an end. . Then, go to your graphical package manager: Muon, Synaptic or whatever. From there, install again ttf-mscorefonts-installer.

    More than 1 system language?
    Another point of attention is relevant in case you have more then 1 "system language" in your system: Dutch, French, Spanish, Italian, Russian or whatever. They do come back in a new system configuration in case they are at the list of installed packages.However, you need to check whether spell checkers for those .languages are present in packages like Firefox, KMail and Libre Office. If so, perfect! If not, act as follows:
    + go to SYSTEM SETTINGS > locale > system languages > tab "uninstall".
    + leave the first system language, UNinstall each other language;
    + then go to the tab "install" and (re)install from there each language you want in your system.

    This it it for now ... I hope it benefits someone.
    Respectfully yours,
    Bas Roufs.
    Last edited by Bas Roufs; June 5th, 2012 at 12:32 PM.

  10. #110
    Join Date
    Dec 2008
    Beans
    3

    Smile Re: HowTo: Create a list of installed packages

    Hey there I read you post and I am new at this and want to
    know how I create a script, I am runnin K10.10mm?

    rayy

Page 11 of 14 FirstFirst ... 910111213 ... 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
  •