repositories.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <!DOCTYPE html>
  2. </ul></div></nav></div></header><div class="site-inner"><div class="content-sidebar-wrap"><main class="content" id="genesis-content"><div class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">You are here: <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a class="breadcrumb-link" href="https://itsfoss.com/" itemprop="item"><span class="breadcrumb-link-text-wrap" itemprop="name">Home</span></a><meta itemprop="position" content="1"></span> <span aria-label="breadcrumb separator">/</span> <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a class="breadcrumb-link" href="https://itsfoss.com/category/how-to/" itemprop="item"><span class="breadcrumb-link-text-wrap" itemprop="name">How To</span></a><meta itemprop="position" content="2"></span> <span aria-label="breadcrumb separator">/</span> What are Ubuntu Repositories? How to enable or disable them?</div><article class="post-42447 post type-post status-publish format-standard has-post-thumbnail category-how-to tag-guide tag-ubuntu entry" itemscope itemtype="https://schema.org/CreativeWork"><header class="entry-header"><h1 class="entry-title" itemprop="headline">What are Ubuntu Repositories? How to enable or disable them?</h1>
  3. <p class="entry-meta">Last updated <time class="entry-modified-time" itemprop="dateModified" datetime="2019-03-25T11:44:13+02:00">March 25, 2019</time> By <span class="entry-author" itemprop="author" itemscope itemtype="https://schema.org/Person"><a href="https://itsfoss.com/author/abhishek/" class="entry-author-link" itemprop="url" rel="author"><span class="entry-author-name" itemprop="name">Abhishek Prakash</span></a></span> <span class="entry-comments-link"><a href="https://itsfoss.com/ubuntu-repositories/#comments">7 Comments</a></span> </p></header><div align="center" id="itsfoss_728x90_320x50_ATF">
  4. <script data-cfasync="false" type='text/javascript'>
  5. freestar.queue.push(function () { googletag.display('itsfoss_728x90_320x50_ATF'); });
  6. </script>
  7. </div>
  8. <div class="entry-content" itemprop="text">
  9. <p><strong><em>This detailed article tells you about various repositories like universe, multiverse in Ubuntu and how to enable or disable them. </em></strong></p>
  10. <p>So, you are trying to follow a tutorial from the web and installing a software using apt-get command and it throws you an error:</p>
  11. <pre class="wp-block-preformatted">E: Unable to locate package xyz</pre>
  12. <p>You are surprised because others the package should be available. You search on the internet and come across a solution that you have to enable universe or multiverse repository to install that package.</p>
  13. <p><strong>You can enable universe and multiverse repositories in Ubuntu using the commands below:</strong></p><div id="eaa_after_nth_p" class="eaa-wrapper eaa_after_nth_p eaa_desktop"><div class="eaa-ad " style=""><!-- code from sekindo - Itsfoss.com In-article - outstream -->
  14. <script type="text/javascript" language="javascript" src="https://live.sekindo.com/live/liveView.php?s=97824&vid_viewAction=player&cbuster=[CACHE_BUSTER]&x=500&y=280&vid_outPause=0"></script>
  15. <!-- code from sekindo --></div></div>
  16. <pre class="wp-block-preformatted">sudo add-apt-repository universe multiverse<br>sudo apt update</pre>
  17. <p>You installed the universe and multiverse repository but do you know what are these repositories? How do they play a role in installing packages? Why there are several repositories?</p>
  18. <p>I&#8217;ll explain all these questions in detail here.</p>
  19. <h2>The concept of repositories in Ubuntu</h2>
  20. <p>Okay, so you already know that to <a rel="noreferrer noopener" aria-label="install software in Ubuntu (opens in a new tab)" href="https://itsfoss.com/remove-install-software-ubuntu/" target="_blank">install software in Ubuntu</a>, you can use the <a rel="noreferrer noopener" aria-label="apt command (opens in a new tab)" href="https://itsfoss.com/apt-command-guide/" target="_blank">apt command</a>. This is the same <a href="https://wiki.debian.org/Apt" target="_blank" rel="noreferrer noopener nofollow" aria-label="APT package manager (opens in a new tab)" class="external">APT package manager</a> that Ubuntu Software Center utilizes underneath. So all the software (except Snap packages) that you see in the Software Center are basically from APT.</p>
  21. <p>Have you ever wondered where does the apt program install the programs from? How does it know which packages are available and which are not?</p>
  22. <p>Apt basically works on the repository. A repository is nothing but a server that contains a set of software. Ubuntu provides a set of repositories so that you won&#8217;t have to search on the internet for the installation file of various software of your need. This centralized way of providing software is one of the main strong points of using Linux. </p>
  23. <p>The APT package manager gets the repository information from the /etc/apt/sources.list file and files listed in /etc/apt/sources.list.d directory. Repository information is usually in the following format:</p>
  24. <pre class="wp-block-preformatted">deb http://us.archive.ubuntu.com/ubuntu/ bionic main</pre>
  25. <p>In fact, you can <a href="http://us.archive.ubuntu.com/ubuntu/" target="_blank" rel="noreferrer noopener nofollow" aria-label="go to the above server address (opens in a new tab)" class="external">go to the above server address</a> and see how the repository is structured.</p>
  26. <p>When you <a rel="noreferrer noopener" aria-label="update Ubuntu using the apt update command (opens in a new tab)" href="https://itsfoss.com/update-ubuntu/" target="_blank">update Ubuntu using the apt update command</a>, the apt package manager gets the information about the available packages (and their version info) from the repositories and stores them in local cache. You can see this in /var/lib/apt/lists directory. </p>
  27. <p>Keeping this information locally speeds up the search process because you don&#8217;t have to go through the network and search the database of available packages just to check if a certain package is available or not.</p>
  28. <div style="clear:both; margin-top:0em; margin-bottom:1em;"><a href="https://itsfoss.com/uninstall-ubuntu-linux-windows-dual-boot/" target="_blank" class="u477f78b1c9478ca8427f7b3106a55ca6"><!-- INLINE RELATED POSTS 1/2 //--><style> .u477f78b1c9478ca8427f7b3106a55ca6 { padding:0px; margin: 0; padding-top:1em!important; padding-bottom:1em!important; width:100%; display: block; font-weight:bold; background-color:#eaeaea; border:0!important; border-left:4px solid #34495E!important; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); text-decoration:none; } .u477f78b1c9478ca8427f7b3106a55ca6:active, .u477f78b1c9478ca8427f7b3106a55ca6:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; text-decoration:none; } .u477f78b1c9478ca8427f7b3106a55ca6 { transition: background-color 250ms; webkit-transition: background-color 250ms; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; } .u477f78b1c9478ca8427f7b3106a55ca6 .ctaText { font-weight:bold; color:inherit; text-decoration:none; font-size: 16px; } .u477f78b1c9478ca8427f7b3106a55ca6 .postTitle { color:#000000; text-decoration: underline!important; font-size: 16px; } .u477f78b1c9478ca8427f7b3106a55ca6:hover .postTitle { text-decoration: underline!important; } </style><div style="padding-left:1em; padding-right:1em;"><span class="ctaText">Suggested read</span>&nbsp; <span class="postTitle">How To Uninstall Ubuntu From Windows Dual Boot Safely</span></div></a></div><p>Now you know how repositories play an important role, let&#8217;s see why there are several repositories provided by Ubuntu.</p>
  29. <h2>Ubuntu Repositories: Main, Universe, Multiverse, Restricted and Partner</h2>
  30. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/03/ubuntu-repositories-800x450.png" alt="The concept of repositories in Ubuntu" class="wp-image-52988" srcset="https://itsfoss.com/wp-content/uploads/2019/03/ubuntu-repositories.png 800w, https://itsfoss.com/wp-content/uploads/2019/03/ubuntu-repositories-300x169.png 300w, https://itsfoss.com/wp-content/uploads/2019/03/ubuntu-repositories-768x432.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure></div>
  31. <p>Software in Ubuntu repository are divided into five categories: main, universe, multiverse, restricted and partner.</p>
  32. <p>Why Ubuntu does that? Why not put all the software into one single repository? To answer this question, let&#8217;s see what are these repositories:</p>
  33. <h3><strong>Main</strong></h3>
  34. <p>When you install Ubuntu, this is the repository enabled by default. The main repository consists of only FOSS (free and open source software) that can be distributed freely without any restrictions.</p>
  35. <p>Software in this repository are fully supported by the Ubuntu developers. This is what Ubuntu will provide with security updates until your system reaches end of life.</p>
  36. <h3><strong>Universe</strong></h3>
  37. <p>This repository also consists free and open source software but Ubuntu doesn&#8217;t guarantee of regular security updates to software in this category.</p>
  38. <p>Software in this category are packaged and maintained by the community. The Universe repository has a vast amount of open source software and thus it enables you to have access to a huge number of software via apt package manager.</p>
  39. <h3><strong>Multiverse</strong></h3>
  40. <p>Multiverse contains the software that are not FOSS. Due to licensing and legal issues, Ubuntu cannot enable this repository by default and cannot provide fix and updates.</p>
  41. <p>It&#8217;s up to you to decide if you want to use Multiverse repository and check if you have the right to use the software.</p>
  42. <h3><strong>Restricted</strong></h3>
  43. <p>Ubuntu tries to provide only free and open source software but that&#8217;s not always possible specially when it comes to supporting hardware.</p>
  44. <p>The restricted repositories consists of proprietary drivers.</p>
  45. <h3><strong>Partner</strong></h3>
  46. <p>This repository consist of proprietary software packaged by Ubuntu for their partners. Earlier, Ubuntu used to provide Skype trough this repository.</p>
  47. <h3>Third party repositories and PPA (Not provided by Ubuntu)</h3>
  48. <p>The above five repositories are provided by Ubuntu. You can also add third party repositories (it&#8217;s up to you if you want to do it) to access more software or to access newer version of a software (as Ubuntu might provide old version of the same software).</p>
  49. <p>For example, if you add the repository provided by <a href="https://itsfoss.com/install-virtualbox-ubuntu/" target="_blank" rel="noreferrer noopener" aria-label="VirtualBox (opens in a new tab)">VirtualBox</a>, you can get the latest version of VurtualBox. It will add a new entry in your sources.list.</p>
  50. <div style="clear:both; margin-top:0em; margin-bottom:1em;"><a href="https://itsfoss.com/ubuntu-terminal-train/" target="_blank" class="u683d59f78ec0313792a77fcfc043fbbf"><!-- INLINE RELATED POSTS 2/2 //--><style> .u683d59f78ec0313792a77fcfc043fbbf { padding:0px; margin: 0; padding-top:1em!important; padding-bottom:1em!important; width:100%; display: block; font-weight:bold; background-color:#eaeaea; border:0!important; border-left:4px solid #34495E!important; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); text-decoration:none; } .u683d59f78ec0313792a77fcfc043fbbf:active, .u683d59f78ec0313792a77fcfc043fbbf:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; text-decoration:none; } .u683d59f78ec0313792a77fcfc043fbbf { transition: background-color 250ms; webkit-transition: background-color 250ms; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; } .u683d59f78ec0313792a77fcfc043fbbf .ctaText { font-weight:bold; color:inherit; text-decoration:none; font-size: 16px; } .u683d59f78ec0313792a77fcfc043fbbf .postTitle { color:#000000; text-decoration: underline!important; font-size: 16px; } .u683d59f78ec0313792a77fcfc043fbbf:hover .postTitle { text-decoration: underline!important; } </style><div style="padding-left:1em; padding-right:1em;"><span class="ctaText">Suggested read</span>&nbsp; <span class="postTitle">Watch These Kids Having Fun With Linux Terminal In Ubuntu</span></div></a></div><p>You can also install additional application using PPA (Personal Package Archive). I have written about <a href="https://itsfoss.com/ppa-guide/" target="_blank" rel="noreferrer noopener" aria-label="what is PPA and how it works (opens in a new tab)">what is PPA and how it works</a> in detail so please read that article.</p>
  51. <div style="color:#32373c;background-color:#ffdd57" class="wp-block-atomic-blocks-ab-notice ab-font-size-18 ab-block-notice" data-id="12ae2a"><div class="ab-notice-title" style="color:#000000"><p>Tip</p></div><div class="ab-notice-text" style="border-color:#ffdd57"><p>Try NOT adding anything other than Ubuntu&#8217;s repositories in your sources.list file. You should keep this file in pristine condition because if you mess it up, you won&#8217;t be able to update your system or (at times) even install new packages.</p></div></div>
  52. <h2>Add universe, multiverse and other repositories</h2>
  53. <p>As I had mentioned earlier, only the Main repository is enabled by default when you install Ubuntu. To access more software, you can add the additional repositories.</p>
  54. <p>Let me show you how to do it in command line first and then I&#8217;ll show you the GUI ways as well.</p>
  55. <p>To enable Universe repository, use:</p>
  56. <pre class="wp-block-preformatted">sudo add-apt-repository universe</pre>
  57. <p>To enable Restricted repository, use:</p>
  58. <pre class="wp-block-preformatted">sudo add-apt-repository restricted</pre>
  59. <p>To enable Multiverse repository, use this command:</p>
  60. <pre class="wp-block-preformatted">sudo add-apt-repository multiverse</pre>
  61. <p>You must use sudo apt update command after adding the repository so that you system creates the local cache with package information.</p>
  62. <p>If you want to <strong>remove a repository</strong>, simply add -r like <strong>sudo add-apt-repository -r universe</strong>.</p>
  63. <p>Graphically, go to Software &amp; Updates and you can enable the repositories here:</p>
  64. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/03/enable-repositories-ubuntu-800x490.png" alt="Add repositories in Ubuntu" class="wp-image-52977" srcset="https://itsfoss.com/wp-content/uploads/2019/03/enable-repositories-ubuntu.png 800w, https://itsfoss.com/wp-content/uploads/2019/03/enable-repositories-ubuntu-300x184.png 300w, https://itsfoss.com/wp-content/uploads/2019/03/enable-repositories-ubuntu-768x470.png 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>Adding Universe, Restricted and Multiverse repositories</figcaption></figure></div>
  65. <p>You&#8217;ll find the option to enable partner repository in the Other Software tab.</p>
  66. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/03/enable-partner-repository-ubuntu-800x490.png" alt="Add partner repository in Ubuntu" class="wp-image-52978" srcset="https://itsfoss.com/wp-content/uploads/2019/03/enable-partner-repository-ubuntu.png 800w, https://itsfoss.com/wp-content/uploads/2019/03/enable-partner-repository-ubuntu-300x184.png 300w, https://itsfoss.com/wp-content/uploads/2019/03/enable-partner-repository-ubuntu-768x470.png 768w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>Adding Partner repository</figcaption></figure></div>
  67. <p>To disable a repository, simply uncheck the box.</p>
  68. <h2>Bonus Tip: How to know which repository a package belongs to? </h2>
  69. <p>Ubuntu has a dedicated website that provides you with information about all the packages available in the Ubuntu archive. Go to Ubuntu Packages website.</p>
  70. <div class="wp-block-button aligncenter"><a class="wp-block-button__link external" href="https://packages.ubuntu.com" rel="nofollow" target="_blank">Ubuntu Packages</a></div>
  71. <p>You can search for a package name in the search field. You can select if you are looking for a particular Ubuntu release or a particular repository. I prefer using &#8216;any&#8217; option in both fields.</p>
  72. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive.png" alt="Search packages in Ubuntu" class="wp-image-52981" srcset="https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive.png 799w, https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive-300x117.png 300w, https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive-768x299.png 768w" sizes="(max-width: 799px) 100vw, 799px" /></figure></div>
  73. <p>It will show you all the matching packages, Ubuntu releases and the repository information.</p>
  74. <div class="wp-block-image"><figure class="aligncenter"><img src="https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive-1-800x454.png" alt="Searching packages in Ubuntu" class="wp-image-52982" srcset="https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive-1.png 800w, https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive-1-300x170.png 300w, https://itsfoss.com/wp-content/uploads/2019/03/search-packages-ubuntu-archive-1-768x436.png 768w" sizes="(max-width: 800px) 100vw, 800px" /></figure></div>
  75. <p>As you can see above the package tor is available in the Universe repository for various Ubuntu releases.</p>
  76. <p class="has-large-font-size"><strong>Conclusion</strong></p>
  77. <p>I hope this article helped you in understanding the concept of repositories in Ubuntu. </p>
  78. <p>If you have any questions or suggestions, please feel free to leave a comment below. If you liked the article, please share it on social media sites like Reddit and Hacker News.</p>