apt-get update only for a specific repository The 2019 Stack Overflow Developer Survey Results Are InCan do an “apt-get update” but for only for one package?apt-get update for a particular repositoryWhy do I need to check updates after adding a ppaHow can I update only newly added repositories?Update only one non-ppa repositoryapt-get update specific list?apt-get update only universe and multiverse reposHow do I check only security updates from the command-line?Any way to skip the huge apt-cache-update everytime a repository is added?Disable automatic execution of apt update after running add-apt-repository on Ubuntu 18.XErrors on apt-get updateapt-get update error for a personal repositoryCan do an “apt-get update” but for only for one package?apt-get update specific list?Update only one non-ppa repositoryapt-get update problem when updating a reprepro repositoryCan a ppa repository be added to /etc/apt/source.list?How does apt-get suggestion works?Does apt-get install package from ppa first and then official repository?SSH repository apt get update without password

Why do UK politicians seemingly ignore opinion polls on Brexit?

How to type this arrow in math mode?

Why did Acorn's A3000 have red function keys?

Identify This Plant (Flower)

How technical should a Scrum Master be to effectively remove impediments?

Origin of "cooter" meaning "vagina"

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

How to save as into a customized destination on macOS?

Is flight data recorder erased after every flight?

Have you ever entered Singapore using a different passport or name?

Time travel alters history but people keep saying nothing's changed

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

What is the meaning of Triage in Cybersec world?

What is the closest word meaning "respect for time / mindful"

Is an up-to-date browser secure on an out-of-date OS?

Did Section 31 appear in Star Trek: The Next Generation?

What is the motivation for a law requiring 2 parties to consent for recording a conversation

What does "fetching by region is not available for SAM files" means?

Can a flute soloist sit?

Why can Shazam fly?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

Is "plugging out" electronic devices an American expression?

Resizing object distorts it (Illustrator CC 2018)

Falsification in Math vs Science



apt-get update only for a specific repository



The 2019 Stack Overflow Developer Survey Results Are InCan do an “apt-get update” but for only for one package?apt-get update for a particular repositoryWhy do I need to check updates after adding a ppaHow can I update only newly added repositories?Update only one non-ppa repositoryapt-get update specific list?apt-get update only universe and multiverse reposHow do I check only security updates from the command-line?Any way to skip the huge apt-cache-update everytime a repository is added?Disable automatic execution of apt update after running add-apt-repository on Ubuntu 18.XErrors on apt-get updateapt-get update error for a personal repositoryCan do an “apt-get update” but for only for one package?apt-get update specific list?Update only one non-ppa repositoryapt-get update problem when updating a reprepro repositoryCan a ppa repository be added to /etc/apt/source.list?How does apt-get suggestion works?Does apt-get install package from ppa first and then official repository?SSH repository apt get update without password



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








104















When I add a PPA and I want to install some of its content, it is quite annoying to re-update all my apt list using apt-get update.



Is it instead possible to only sync the content of a given repository?










share|improve this question



















  • 1





    Starting from wily, you could just use add-apt-repository -u

    – Treviño
    Jul 17 '15 at 22:34











  • There is no -u on Ubuntu (15.x) Vivid as far as I can tell.

    – kenorb
    Nov 14 '15 at 19:53











  • @Treviño It isn't mentioned in the Wily manpage: manpages.ubuntu.com/manpages/wily/en/man1/… Is it documented elsewhere?

    – muru
    Feb 11 '16 at 20:26











  • @muru I think that has to be fixed, it's only mentioned on add-apt-repository --help. Please open a bug asking to fix the manpage.

    – Treviño
    Feb 19 '16 at 0:26











  • @Treviño @muru FYI, the -u functionality was removed since 18.04. See askubuntu.com/questions/65245/…

    – wisbucky
    39 mins ago

















104















When I add a PPA and I want to install some of its content, it is quite annoying to re-update all my apt list using apt-get update.



Is it instead possible to only sync the content of a given repository?










share|improve this question



















  • 1





    Starting from wily, you could just use add-apt-repository -u

    – Treviño
    Jul 17 '15 at 22:34











  • There is no -u on Ubuntu (15.x) Vivid as far as I can tell.

    – kenorb
    Nov 14 '15 at 19:53











  • @Treviño It isn't mentioned in the Wily manpage: manpages.ubuntu.com/manpages/wily/en/man1/… Is it documented elsewhere?

    – muru
    Feb 11 '16 at 20:26











  • @muru I think that has to be fixed, it's only mentioned on add-apt-repository --help. Please open a bug asking to fix the manpage.

    – Treviño
    Feb 19 '16 at 0:26











  • @Treviño @muru FYI, the -u functionality was removed since 18.04. See askubuntu.com/questions/65245/…

    – wisbucky
    39 mins ago













104












104








104


45






When I add a PPA and I want to install some of its content, it is quite annoying to re-update all my apt list using apt-get update.



Is it instead possible to only sync the content of a given repository?










share|improve this question
















When I add a PPA and I want to install some of its content, it is quite annoying to re-update all my apt list using apt-get update.



Is it instead possible to only sync the content of a given repository?







apt package-management software-sources






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 '17 at 5:19









Anwar

57.5k22149257




57.5k22149257










asked Oct 11 '11 at 9:42









TreviñoTreviño

1,57621220




1,57621220







  • 1





    Starting from wily, you could just use add-apt-repository -u

    – Treviño
    Jul 17 '15 at 22:34











  • There is no -u on Ubuntu (15.x) Vivid as far as I can tell.

    – kenorb
    Nov 14 '15 at 19:53











  • @Treviño It isn't mentioned in the Wily manpage: manpages.ubuntu.com/manpages/wily/en/man1/… Is it documented elsewhere?

    – muru
    Feb 11 '16 at 20:26











  • @muru I think that has to be fixed, it's only mentioned on add-apt-repository --help. Please open a bug asking to fix the manpage.

    – Treviño
    Feb 19 '16 at 0:26











  • @Treviño @muru FYI, the -u functionality was removed since 18.04. See askubuntu.com/questions/65245/…

    – wisbucky
    39 mins ago












  • 1





    Starting from wily, you could just use add-apt-repository -u

    – Treviño
    Jul 17 '15 at 22:34











  • There is no -u on Ubuntu (15.x) Vivid as far as I can tell.

    – kenorb
    Nov 14 '15 at 19:53











  • @Treviño It isn't mentioned in the Wily manpage: manpages.ubuntu.com/manpages/wily/en/man1/… Is it documented elsewhere?

    – muru
    Feb 11 '16 at 20:26











  • @muru I think that has to be fixed, it's only mentioned on add-apt-repository --help. Please open a bug asking to fix the manpage.

    – Treviño
    Feb 19 '16 at 0:26











  • @Treviño @muru FYI, the -u functionality was removed since 18.04. See askubuntu.com/questions/65245/…

    – wisbucky
    39 mins ago







1




1





Starting from wily, you could just use add-apt-repository -u

– Treviño
Jul 17 '15 at 22:34





Starting from wily, you could just use add-apt-repository -u

– Treviño
Jul 17 '15 at 22:34













There is no -u on Ubuntu (15.x) Vivid as far as I can tell.

– kenorb
Nov 14 '15 at 19:53





There is no -u on Ubuntu (15.x) Vivid as far as I can tell.

– kenorb
Nov 14 '15 at 19:53













@Treviño It isn't mentioned in the Wily manpage: manpages.ubuntu.com/manpages/wily/en/man1/… Is it documented elsewhere?

– muru
Feb 11 '16 at 20:26





@Treviño It isn't mentioned in the Wily manpage: manpages.ubuntu.com/manpages/wily/en/man1/… Is it documented elsewhere?

– muru
Feb 11 '16 at 20:26













@muru I think that has to be fixed, it's only mentioned on add-apt-repository --help. Please open a bug asking to fix the manpage.

– Treviño
Feb 19 '16 at 0:26





@muru I think that has to be fixed, it's only mentioned on add-apt-repository --help. Please open a bug asking to fix the manpage.

– Treviño
Feb 19 '16 at 0:26













@Treviño @muru FYI, the -u functionality was removed since 18.04. See askubuntu.com/questions/65245/…

– wisbucky
39 mins ago





@Treviño @muru FYI, the -u functionality was removed since 18.04. See askubuntu.com/questions/65245/…

– wisbucky
39 mins ago










5 Answers
5






active

oldest

votes


















81















yes, apt-get can do that, and can do it in a nice way.




  1. Append following to ~/.bash_funcs



    update-repo() 
    for source in "$@"; do
    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$source"
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
    done




  2. Append following to ~/.bashrc



    if [ -f $HOME/.bash_funcs ]; then
    . $HOME/.bash_funcs
    fi



  3. Append following to ~/.bash_completion



    # Debian user-defined completion -*- shell-script -*-

    _ppa_lists() &&
    complete -F _ppa_lists update-repo



  4. Then source the files



    . ~/.bashrc
    . ~/.bash_completion



  5. Done and start to fire it



    update-repo <tab> <tab>


You can update a single ppa repository without having to update whole apt source, with implement of bash-completion.






share|improve this answer




















  • 14





    You should package this.

    – PyRulez
    Apr 24 '14 at 19:44






  • 3





    Are you sure the autocompletion script is working?

    – qed
    Jun 5 '14 at 15:33






  • 1





    When I hit Tab it shows update-repo _init_completion: command not found

    – kevy
    Mar 13 '15 at 17:38







  • 2





    FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

    – Jay _silly_evarlast_ Wren
    May 30 '15 at 0:50






  • 2





    @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

    – Jay _silly_evarlast_ Wren
    Oct 6 '15 at 17:57


















40














If the repository is configured in a specific file in the directory /etc/apt/sources.list.d/, say myrepo.list, you can update that single repository with the command:



sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/myrepo.list" 
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"


Nevertheless this is not very convenient.

This can be simplified defining a bash function



update_repo() 
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list"
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"



so that you can simply run



update_repo myrepo





share|improve this answer

























  • I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

    – Treviño
    Nov 13 '11 at 19:25






  • 1





    can you explain what does '-' mean in sourceparts config?

    – Sajuuk
    Apr 3 at 2:14












  • I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

    – randomness
    yesterday


















12














Y PPA Manager comes with a command line tool called update-ppa that lets you update a single PPA.



For example:



sudo update-ppa ppa:nilarimogard/webupd8


Also, when adding a PPA through Y PPA Manager, the PPA source is automatically updated (only for that PPA). In a future version, there's going to be a GUI to manually update single PPAs as well.



More information about Y PPA Manager, HERE.






share|improve this answer




















  • 5





    sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

    – mchid
    Nov 8 '14 at 5:16


















8














To update a specific repository, use -o, e.g.:



apt-get update -o Dir::Etc::sourcelist=/path/to/repo.list


Here is a one-liner updating only recently added apt repository



find /etc/apt/sources.list.d -type f -name '*.list' -exec sudo apt-get update -o Dir::Etc::sourcelist="" ';'


It's much quicker than updating all repositories, especially during VM provisioning after adding new.






share|improve this answer


















  • 3





    I think this updates everything found in /path/to

    – John Bachir
    Jul 30 '16 at 2:33











  • @JohnBachir Exactly.

    – Roman
    Mar 29 '18 at 15:38


















0














The -u option was added in 15.10. From 15.10 to 17.10, you could use -u to automatically update only the specific repo you are adding:



add-apt-repository -u my-ppa



The silly thing is that this option was not added to man until 18.04 (it was documented in add-apt-repository --help, however). But in 18.04, this functionality was removed! (Again, not in man, but you can see in add-apt-repository --help).



In 18.04, the update functionality was changed to always do a full apt-get update after add-apt-repository. The -u option was effectively removed. It remains there for legacy syntax, but it is always set to options.update = False. In 18.04, you do have the option of -n, --no-update, which is like the old behavior. But it's all or nothing, you cannot update a single repo since 18.04.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f65245%2fapt-get-update-only-for-a-specific-repository%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    5 Answers
    5






    active

    oldest

    votes








    5 Answers
    5






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    81















    yes, apt-get can do that, and can do it in a nice way.




    1. Append following to ~/.bash_funcs



      update-repo() 
      for source in "$@"; do
      sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$source"
      -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
      done




    2. Append following to ~/.bashrc



      if [ -f $HOME/.bash_funcs ]; then
      . $HOME/.bash_funcs
      fi



    3. Append following to ~/.bash_completion



      # Debian user-defined completion -*- shell-script -*-

      _ppa_lists() &&
      complete -F _ppa_lists update-repo



    4. Then source the files



      . ~/.bashrc
      . ~/.bash_completion



    5. Done and start to fire it



      update-repo <tab> <tab>


    You can update a single ppa repository without having to update whole apt source, with implement of bash-completion.






    share|improve this answer




















    • 14





      You should package this.

      – PyRulez
      Apr 24 '14 at 19:44






    • 3





      Are you sure the autocompletion script is working?

      – qed
      Jun 5 '14 at 15:33






    • 1





      When I hit Tab it shows update-repo _init_completion: command not found

      – kevy
      Mar 13 '15 at 17:38







    • 2





      FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

      – Jay _silly_evarlast_ Wren
      May 30 '15 at 0:50






    • 2





      @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

      – Jay _silly_evarlast_ Wren
      Oct 6 '15 at 17:57















    81















    yes, apt-get can do that, and can do it in a nice way.




    1. Append following to ~/.bash_funcs



      update-repo() 
      for source in "$@"; do
      sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$source"
      -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
      done




    2. Append following to ~/.bashrc



      if [ -f $HOME/.bash_funcs ]; then
      . $HOME/.bash_funcs
      fi



    3. Append following to ~/.bash_completion



      # Debian user-defined completion -*- shell-script -*-

      _ppa_lists() &&
      complete -F _ppa_lists update-repo



    4. Then source the files



      . ~/.bashrc
      . ~/.bash_completion



    5. Done and start to fire it



      update-repo <tab> <tab>


    You can update a single ppa repository without having to update whole apt source, with implement of bash-completion.






    share|improve this answer




















    • 14





      You should package this.

      – PyRulez
      Apr 24 '14 at 19:44






    • 3





      Are you sure the autocompletion script is working?

      – qed
      Jun 5 '14 at 15:33






    • 1





      When I hit Tab it shows update-repo _init_completion: command not found

      – kevy
      Mar 13 '15 at 17:38







    • 2





      FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

      – Jay _silly_evarlast_ Wren
      May 30 '15 at 0:50






    • 2





      @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

      – Jay _silly_evarlast_ Wren
      Oct 6 '15 at 17:57













    81












    81








    81








    yes, apt-get can do that, and can do it in a nice way.




    1. Append following to ~/.bash_funcs



      update-repo() 
      for source in "$@"; do
      sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$source"
      -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
      done




    2. Append following to ~/.bashrc



      if [ -f $HOME/.bash_funcs ]; then
      . $HOME/.bash_funcs
      fi



    3. Append following to ~/.bash_completion



      # Debian user-defined completion -*- shell-script -*-

      _ppa_lists() &&
      complete -F _ppa_lists update-repo



    4. Then source the files



      . ~/.bashrc
      . ~/.bash_completion



    5. Done and start to fire it



      update-repo <tab> <tab>


    You can update a single ppa repository without having to update whole apt source, with implement of bash-completion.






    share|improve this answer
















    yes, apt-get can do that, and can do it in a nice way.




    1. Append following to ~/.bash_funcs



      update-repo() 
      for source in "$@"; do
      sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$source"
      -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
      done




    2. Append following to ~/.bashrc



      if [ -f $HOME/.bash_funcs ]; then
      . $HOME/.bash_funcs
      fi



    3. Append following to ~/.bash_completion



      # Debian user-defined completion -*- shell-script -*-

      _ppa_lists() &&
      complete -F _ppa_lists update-repo



    4. Then source the files



      . ~/.bashrc
      . ~/.bash_completion



    5. Done and start to fire it



      update-repo <tab> <tab>


    You can update a single ppa repository without having to update whole apt source, with implement of bash-completion.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jun 8 '14 at 0:02









    thebugfinder

    1,29179




    1,29179










    answered Oct 7 '12 at 20:03









    funicornfunicorn

    1,2321011




    1,2321011







    • 14





      You should package this.

      – PyRulez
      Apr 24 '14 at 19:44






    • 3





      Are you sure the autocompletion script is working?

      – qed
      Jun 5 '14 at 15:33






    • 1





      When I hit Tab it shows update-repo _init_completion: command not found

      – kevy
      Mar 13 '15 at 17:38







    • 2





      FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

      – Jay _silly_evarlast_ Wren
      May 30 '15 at 0:50






    • 2





      @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

      – Jay _silly_evarlast_ Wren
      Oct 6 '15 at 17:57












    • 14





      You should package this.

      – PyRulez
      Apr 24 '14 at 19:44






    • 3





      Are you sure the autocompletion script is working?

      – qed
      Jun 5 '14 at 15:33






    • 1





      When I hit Tab it shows update-repo _init_completion: command not found

      – kevy
      Mar 13 '15 at 17:38







    • 2





      FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

      – Jay _silly_evarlast_ Wren
      May 30 '15 at 0:50






    • 2





      @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

      – Jay _silly_evarlast_ Wren
      Oct 6 '15 at 17:57







    14




    14





    You should package this.

    – PyRulez
    Apr 24 '14 at 19:44





    You should package this.

    – PyRulez
    Apr 24 '14 at 19:44




    3




    3





    Are you sure the autocompletion script is working?

    – qed
    Jun 5 '14 at 15:33





    Are you sure the autocompletion script is working?

    – qed
    Jun 5 '14 at 15:33




    1




    1





    When I hit Tab it shows update-repo _init_completion: command not found

    – kevy
    Mar 13 '15 at 17:38






    When I hit Tab it shows update-repo _init_completion: command not found

    – kevy
    Mar 13 '15 at 17:38





    2




    2





    FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

    – Jay _silly_evarlast_ Wren
    May 30 '15 at 0:50





    FYI: I've used the knowledge I gained from this post to propose an option to add-apt-repository to do this automatically. code.launchpad.net/~evarlast/software-properties/support-update/…

    – Jay _silly_evarlast_ Wren
    May 30 '15 at 0:50




    2




    2





    @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

    – Jay _silly_evarlast_ Wren
    Oct 6 '15 at 17:57





    @CiprianTomoiaga It got merged, but the source is here: bazaar.launchpad.net/~evarlast/software-properties/… I'm hoping it will be in wily.

    – Jay _silly_evarlast_ Wren
    Oct 6 '15 at 17:57













    40














    If the repository is configured in a specific file in the directory /etc/apt/sources.list.d/, say myrepo.list, you can update that single repository with the command:



    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/myrepo.list" 
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"


    Nevertheless this is not very convenient.

    This can be simplified defining a bash function



    update_repo() 
    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list"
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"



    so that you can simply run



    update_repo myrepo





    share|improve this answer

























    • I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

      – Treviño
      Nov 13 '11 at 19:25






    • 1





      can you explain what does '-' mean in sourceparts config?

      – Sajuuk
      Apr 3 at 2:14












    • I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

      – randomness
      yesterday















    40














    If the repository is configured in a specific file in the directory /etc/apt/sources.list.d/, say myrepo.list, you can update that single repository with the command:



    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/myrepo.list" 
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"


    Nevertheless this is not very convenient.

    This can be simplified defining a bash function



    update_repo() 
    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list"
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"



    so that you can simply run



    update_repo myrepo





    share|improve this answer

























    • I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

      – Treviño
      Nov 13 '11 at 19:25






    • 1





      can you explain what does '-' mean in sourceparts config?

      – Sajuuk
      Apr 3 at 2:14












    • I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

      – randomness
      yesterday













    40












    40








    40







    If the repository is configured in a specific file in the directory /etc/apt/sources.list.d/, say myrepo.list, you can update that single repository with the command:



    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/myrepo.list" 
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"


    Nevertheless this is not very convenient.

    This can be simplified defining a bash function



    update_repo() 
    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list"
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"



    so that you can simply run



    update_repo myrepo





    share|improve this answer















    If the repository is configured in a specific file in the directory /etc/apt/sources.list.d/, say myrepo.list, you can update that single repository with the command:



    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/myrepo.list" 
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"


    Nevertheless this is not very convenient.

    This can be simplified defining a bash function



    update_repo() 
    sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/$1.list"
    -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"



    so that you can simply run



    update_repo myrepo






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Aug 6 '12 at 10:55









    crass

    435




    435










    answered Oct 11 '11 at 10:24









    enzotibenzotib

    65.2k8136155




    65.2k8136155












    • I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

      – Treviño
      Nov 13 '11 at 19:25






    • 1





      can you explain what does '-' mean in sourceparts config?

      – Sajuuk
      Apr 3 at 2:14












    • I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

      – randomness
      yesterday

















    • I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

      – Treviño
      Nov 13 '11 at 19:25






    • 1





      can you explain what does '-' mean in sourceparts config?

      – Sajuuk
      Apr 3 at 2:14












    • I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

      – randomness
      yesterday
















    I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

    – Treviño
    Nov 13 '11 at 19:25





    I've checked this again, but it doesn't work if then you want to install a package that has some unresolved dependency on another repository (also in the main archive)

    – Treviño
    Nov 13 '11 at 19:25




    1




    1





    can you explain what does '-' mean in sourceparts config?

    – Sajuuk
    Apr 3 at 2:14






    can you explain what does '-' mean in sourceparts config?

    – Sajuuk
    Apr 3 at 2:14














    I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

    – randomness
    yesterday





    I think '-' just a dummy way to tell sourceparts should not be used. See github.com/Debian/apt/blob/master/apt-pkg/sourcelist.cc#L313 . I could be wrong though, couldn't find a proper doc explaining the '-'.

    – randomness
    yesterday











    12














    Y PPA Manager comes with a command line tool called update-ppa that lets you update a single PPA.



    For example:



    sudo update-ppa ppa:nilarimogard/webupd8


    Also, when adding a PPA through Y PPA Manager, the PPA source is automatically updated (only for that PPA). In a future version, there's going to be a GUI to manually update single PPAs as well.



    More information about Y PPA Manager, HERE.






    share|improve this answer




















    • 5





      sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

      – mchid
      Nov 8 '14 at 5:16















    12














    Y PPA Manager comes with a command line tool called update-ppa that lets you update a single PPA.



    For example:



    sudo update-ppa ppa:nilarimogard/webupd8


    Also, when adding a PPA through Y PPA Manager, the PPA source is automatically updated (only for that PPA). In a future version, there's going to be a GUI to manually update single PPAs as well.



    More information about Y PPA Manager, HERE.






    share|improve this answer




















    • 5





      sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

      – mchid
      Nov 8 '14 at 5:16













    12












    12








    12







    Y PPA Manager comes with a command line tool called update-ppa that lets you update a single PPA.



    For example:



    sudo update-ppa ppa:nilarimogard/webupd8


    Also, when adding a PPA through Y PPA Manager, the PPA source is automatically updated (only for that PPA). In a future version, there's going to be a GUI to manually update single PPAs as well.



    More information about Y PPA Manager, HERE.






    share|improve this answer















    Y PPA Manager comes with a command line tool called update-ppa that lets you update a single PPA.



    For example:



    sudo update-ppa ppa:nilarimogard/webupd8


    Also, when adding a PPA through Y PPA Manager, the PPA source is automatically updated (only for that PPA). In a future version, there's going to be a GUI to manually update single PPAs as well.



    More information about Y PPA Manager, HERE.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 12 '14 at 13:28









    Anwar

    57.5k22149257




    57.5k22149257










    answered Oct 5 '12 at 11:48









    Alin AndreiAlin Andrei

    7,02433554




    7,02433554







    • 5





      sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

      – mchid
      Nov 8 '14 at 5:16












    • 5





      sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

      – mchid
      Nov 8 '14 at 5:16







    5




    5





    sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

    – mchid
    Nov 8 '14 at 5:16





    sudo add-apt-repository ppa:webupd8team/y-ppa-manager then sudo apt-get update and finally sudo apt-get install y-ppa-manager

    – mchid
    Nov 8 '14 at 5:16











    8














    To update a specific repository, use -o, e.g.:



    apt-get update -o Dir::Etc::sourcelist=/path/to/repo.list


    Here is a one-liner updating only recently added apt repository



    find /etc/apt/sources.list.d -type f -name '*.list' -exec sudo apt-get update -o Dir::Etc::sourcelist="" ';'


    It's much quicker than updating all repositories, especially during VM provisioning after adding new.






    share|improve this answer


















    • 3





      I think this updates everything found in /path/to

      – John Bachir
      Jul 30 '16 at 2:33











    • @JohnBachir Exactly.

      – Roman
      Mar 29 '18 at 15:38















    8














    To update a specific repository, use -o, e.g.:



    apt-get update -o Dir::Etc::sourcelist=/path/to/repo.list


    Here is a one-liner updating only recently added apt repository



    find /etc/apt/sources.list.d -type f -name '*.list' -exec sudo apt-get update -o Dir::Etc::sourcelist="" ';'


    It's much quicker than updating all repositories, especially during VM provisioning after adding new.






    share|improve this answer


















    • 3





      I think this updates everything found in /path/to

      – John Bachir
      Jul 30 '16 at 2:33











    • @JohnBachir Exactly.

      – Roman
      Mar 29 '18 at 15:38













    8












    8








    8







    To update a specific repository, use -o, e.g.:



    apt-get update -o Dir::Etc::sourcelist=/path/to/repo.list


    Here is a one-liner updating only recently added apt repository



    find /etc/apt/sources.list.d -type f -name '*.list' -exec sudo apt-get update -o Dir::Etc::sourcelist="" ';'


    It's much quicker than updating all repositories, especially during VM provisioning after adding new.






    share|improve this answer













    To update a specific repository, use -o, e.g.:



    apt-get update -o Dir::Etc::sourcelist=/path/to/repo.list


    Here is a one-liner updating only recently added apt repository



    find /etc/apt/sources.list.d -type f -name '*.list' -exec sudo apt-get update -o Dir::Etc::sourcelist="" ';'


    It's much quicker than updating all repositories, especially during VM provisioning after adding new.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 14 '15 at 20:08









    kenorbkenorb

    4,83014054




    4,83014054







    • 3





      I think this updates everything found in /path/to

      – John Bachir
      Jul 30 '16 at 2:33











    • @JohnBachir Exactly.

      – Roman
      Mar 29 '18 at 15:38












    • 3





      I think this updates everything found in /path/to

      – John Bachir
      Jul 30 '16 at 2:33











    • @JohnBachir Exactly.

      – Roman
      Mar 29 '18 at 15:38







    3




    3





    I think this updates everything found in /path/to

    – John Bachir
    Jul 30 '16 at 2:33





    I think this updates everything found in /path/to

    – John Bachir
    Jul 30 '16 at 2:33













    @JohnBachir Exactly.

    – Roman
    Mar 29 '18 at 15:38





    @JohnBachir Exactly.

    – Roman
    Mar 29 '18 at 15:38











    0














    The -u option was added in 15.10. From 15.10 to 17.10, you could use -u to automatically update only the specific repo you are adding:



    add-apt-repository -u my-ppa



    The silly thing is that this option was not added to man until 18.04 (it was documented in add-apt-repository --help, however). But in 18.04, this functionality was removed! (Again, not in man, but you can see in add-apt-repository --help).



    In 18.04, the update functionality was changed to always do a full apt-get update after add-apt-repository. The -u option was effectively removed. It remains there for legacy syntax, but it is always set to options.update = False. In 18.04, you do have the option of -n, --no-update, which is like the old behavior. But it's all or nothing, you cannot update a single repo since 18.04.






    share|improve this answer



























      0














      The -u option was added in 15.10. From 15.10 to 17.10, you could use -u to automatically update only the specific repo you are adding:



      add-apt-repository -u my-ppa



      The silly thing is that this option was not added to man until 18.04 (it was documented in add-apt-repository --help, however). But in 18.04, this functionality was removed! (Again, not in man, but you can see in add-apt-repository --help).



      In 18.04, the update functionality was changed to always do a full apt-get update after add-apt-repository. The -u option was effectively removed. It remains there for legacy syntax, but it is always set to options.update = False. In 18.04, you do have the option of -n, --no-update, which is like the old behavior. But it's all or nothing, you cannot update a single repo since 18.04.






      share|improve this answer

























        0












        0








        0







        The -u option was added in 15.10. From 15.10 to 17.10, you could use -u to automatically update only the specific repo you are adding:



        add-apt-repository -u my-ppa



        The silly thing is that this option was not added to man until 18.04 (it was documented in add-apt-repository --help, however). But in 18.04, this functionality was removed! (Again, not in man, but you can see in add-apt-repository --help).



        In 18.04, the update functionality was changed to always do a full apt-get update after add-apt-repository. The -u option was effectively removed. It remains there for legacy syntax, but it is always set to options.update = False. In 18.04, you do have the option of -n, --no-update, which is like the old behavior. But it's all or nothing, you cannot update a single repo since 18.04.






        share|improve this answer













        The -u option was added in 15.10. From 15.10 to 17.10, you could use -u to automatically update only the specific repo you are adding:



        add-apt-repository -u my-ppa



        The silly thing is that this option was not added to man until 18.04 (it was documented in add-apt-repository --help, however). But in 18.04, this functionality was removed! (Again, not in man, but you can see in add-apt-repository --help).



        In 18.04, the update functionality was changed to always do a full apt-get update after add-apt-repository. The -u option was effectively removed. It remains there for legacy syntax, but it is always set to options.update = False. In 18.04, you do have the option of -n, --no-update, which is like the old behavior. But it's all or nothing, you cannot update a single repo since 18.04.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 41 mins ago









        wisbuckywisbucky

        884129




        884129



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f65245%2fapt-get-update-only-for-a-specific-repository%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

            fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap

            Where else does the Shulchan Aruch quote an authority by name?Parashat Metzora+HagadolPesach/PassoverShulchan Aruch UTF-8Anonymous glosses in the Shulchan AruchWhy is the Shulchan Aruch definitive?Siman 32, Kitzur Shulchan Aruch: UntranslatedLitvaks/Yeshivish and Shulchan AruchBuying a Shulchan AruchEnglish version of SHULCHAN ARUCHIs there any place where Shulchan Aruch rules with the Rosh against the Rif and Rambam?Are there practices where Sepharadim do not hold by Shulchan Aruch?5th part of the shulchan aruch