Score:1

How to use software-properties-gtk --enable-component=ENABLE_COMPONENT?

cn flag

I would like to enable or disable certain options in the application software-properties-gtk via command-line.

Examples of the options that I am interested to control via command-line are shown below:

a b

I suspect the command software-properties-gtk --enable-component=ENABLE_COMPONENT would allow me to implement what I want. However, manpage does not elaborate what values can be used to replace ENABLE_COMPONENT.

$ software-properties-gtk -h
Usage: software-properties-gtk [options]

Options:
  -h, --help            show this help message and exit
  -d, --debug           Print some debug information to the command line
  -m, --massive-debug   Print a lot of debug information to the command line
  -n, --no-update       No update on repository change (useful if called from
                        an external program).
  -t TOPLEVEL, --toplevel=TOPLEVEL
                        Set x-window-id of the toplevel parent for the dialog
                        (useful for embedding)
  -e ENABLE_COMPONENT, --enable-component=ENABLE_COMPONENT
                        Enable the specified component of the distro's
                        repositories
  --open-tab=OPEN_TAB   Open specific tab number on startup
  --enable-ppa=ENABLE_PPA
                        Enable PPA with the given name
  -k KEYSERVER, --keyserver=KEYSERVER
                        Legacy option, unused
  --data-dir=DATA_DIR   Use data files (UI) from the given directory

Appreciate instruction on using this command?

muru avatar
us flag
https://askubuntu.com/a/58365/158442
Score:2
zw flag

On my Ubuntu 18.04 LTS I see the following:

$ software-properties-gtk --enable-component=main
The --enable-component/-e command-line switch has been 
deprecated. Instead of 'software-properties-gtk -e multiverse' 
you can use 'add-apt-repository multiverse'

So really you have to use

add-apt-repository component

where component is one of the following:

  • main - Canonical-supported free and open-source software.
  • universe - Community-maintained free and open-source software.
  • restricted - Proprietary drivers for devices.
  • multiverse - Software restricted by copyright or legal issues.

So the full commands would be

  • sudo add-apt-repository main
  • sudo add-apt-repository universe
  • sudo add-apt-repository restricted
  • sudo add-apt-repository multiverse

For Canonical Partners you can use the command shown below:

sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -cs) partner"

where lsb_release -cs will return the codename (bionic, focal, hirsute, etc) of your Ubuntu version.


Stuff to read:

  • man sources.list locally or online;
  • man add-apt-repository locally or online.
Sun Bear avatar
cn flag
Thanks. I just came to the same findings as you in 20.04. And to disable a component I should use `sudo add-apt-repository -r main` as an example. There is one other part that I have found a solution to yet and your answer has not mentioned. That is, how to enable/disable `Canonical Partners` in the `Other Software` Tab. Can you elaborate? Thanks.
N0rbert avatar
zw flag
For partners you can use `sudo add-apt-repository "deb http://archive.canonical.com/ubuntu $(lsb_release -cs) partner"` .
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.