forked from docs/doc-exports
Reviewed-by: Muller, Martin <martin.muller@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
40 lines
7.5 KiB
HTML
40 lines
7.5 KiB
HTML
<a name="sfs_01_0027"></a><a name="sfs_01_0027"></a>
|
|
|
|
<h1 class="topictitle1">Enabling or Adding a Software Repository</h1>
|
|
<div id="body1505701992588"><p id="sfs_01_0027__p8060118">This section explains how to enable or add a software repository in CentOS, SUSE, and Ubuntu.</p>
|
|
<div class="section" id="sfs_01_0027__section5187641210364"><h4 class="sectiontitle">CentOS</h4><ol id="sfs_01_0027__ol38838178103618"><li id="sfs_01_0027__li5411239103618"><span>Run the following command to check whether a software repository has been enabled.</span><p><p id="sfs_01_0027__p658292610370"><strong id="sfs_01_0027__b22174884103728">yum repolist all</strong></p>
|
|
<p id="sfs_01_0027__p54138586104353">If <strong id="sfs_01_0027__b842352706143021">status</strong> is <strong id="sfs_01_0027__b842352706143024">disabled</strong>, as shown in <a href="#sfs_01_0027__fig50710110103819">Figure 1</a>, no software repository has been enabled. Proceed to the next step.</p>
|
|
<div class="fignone" id="sfs_01_0027__fig50710110103819"><a name="sfs_01_0027__fig50710110103819"></a><a name="fig50710110103819"></a><span class="figcap"><b>Figure 1 </b>Checking software repositories</span><br><span><img id="sfs_01_0027__image13878235103819" src="en-us_image_0000001516076948.png"></span></div>
|
|
</p></li><li id="sfs_01_0027__li67025606103946"><span>Run the following command to enable a software repository. This step uses <strong id="sfs_01_0027__b1271608998143122">Public-OTC-CentOS-7-Base</strong> as an example.</span><p><p id="sfs_01_0027__p41217152104022"><strong id="sfs_01_0027__b36244950174932">yum-config-manager --enable Public-OTC-CentOS-7-Base</strong></p>
|
|
<div class="fignone" id="sfs_01_0027__fig14720407104057"><span class="figcap"><b>Figure 2 </b>Enabling a software repository</span><br><span><img id="sfs_01_0027__image51502279104057" src="en-us_image_0000001516076956.png"></span></div>
|
|
</p></li><li id="sfs_01_0027__li52678992105456"><span>Run the following command to check whether the software repository described in step 2 has been enabled.</span><p><p id="sfs_01_0027__p38475237105458"><strong id="sfs_01_0027__b3392259110479">yum repolist all</strong></p>
|
|
<div class="p" id="sfs_01_0027__p174375710552">If <strong id="sfs_01_0027__b2093593792">status</strong> is <strong id="sfs_01_0027__b825022212">enabled</strong>, as shown in <a href="#sfs_01_0027__fig33842796104733">Figure 3</a>, the software repository has been enabled.<div class="fignone" id="sfs_01_0027__fig33842796104733"><a name="sfs_01_0027__fig33842796104733"></a><a name="fig33842796104733"></a><span class="figcap"><b>Figure 3 </b>Checking whether the software repository has been enabled</span><br><span><img id="sfs_01_0027__image56911918104733" src="en-us_image_0000001567316449.png"></span></div>
|
|
</div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="sfs_01_0027__section2416343611520"><h4 class="sectiontitle">SUSE</h4><ol id="sfs_01_0027__ol4735433711527"><li id="sfs_01_0027__li2170698811527"><span>Run the following command to check whether a software repository has been enabled.</span><p><p id="sfs_01_0027__en-us_topic_0077171435_p46402639105726"><strong id="sfs_01_0027__en-us_topic_0077171435_b14970570105726">zypper lr</strong></p>
|
|
<p id="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_p54138586104353">If no software repository is detected, as shown in <a href="#sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig50710110103819">Figure 4</a>, proceed to the next step.</p>
|
|
<div class="fignone" id="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig50710110103819"><a name="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig50710110103819"></a><a name="en-us_topic_0077171435_en-us_topic_0077171435_fig50710110103819"></a><span class="figcap"><b>Figure 4 </b>Checking software repositories</span><br><span><img id="sfs_01_0027__image836909211751" src="en-us_image_0000001567076789.png"></span></div>
|
|
</p></li><li id="sfs_01_0027__li14466870214458"><span>Run the following command to add a software repository. This step uses <strong id="sfs_01_0027__b8423527061057">opensuse12.2</strong> as an example.</span><p><div class="p" id="sfs_01_0027__p46144407112734"><strong id="sfs_01_0027__b15695774112244">zypper addrepo http://download.opensuse.org/distribution/12.2/repo/oss/ opensuse-main</strong><div class="fignone" id="sfs_01_0027__fig18983675112352"><span class="figcap"><b>Figure 5 </b>Adding a software repository</span><br><span><img id="sfs_01_0027__image61282683112352" src="en-us_image_0000001516076952.png"></span></div>
|
|
</div>
|
|
</p></li><li id="sfs_01_0027__li25739503112419"><span>Run the following command to update and add software repositories.</span><p><p id="sfs_01_0027__en-us_topic_0077171435_p1552707811327"><strong id="sfs_01_0027__en-us_topic_0077171435_b552597511327">zypper refresh</strong></p>
|
|
<div class="fignone" id="sfs_01_0027__fig1390229711259"><span class="figcap"><b>Figure 6 </b>Updating and adding repositories</span><br><span><img id="sfs_01_0027__image5234431011259" src="en-us_image_0000001567076793.png"></span></div>
|
|
</p></li><li id="sfs_01_0027__li59443011112547"><span>Run the following command to check whether the software repository described in step 2 has been enabled.</span><p><p id="sfs_01_0027__en-us_topic_0077171435_p4308377711412"><strong id="sfs_01_0027__en-us_topic_0077171435_b5220967311412">zypper lr</strong></p>
|
|
<div class="p" id="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_p174375710552">If <strong id="sfs_01_0027__b1119250797">Enabled</strong> is <strong id="sfs_01_0027__b1698327664">Yes</strong>, as shown in <a href="#sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig33842796104733">Figure 7</a>, the software repository has been enabled.<div class="fignone" id="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig33842796104733"><a name="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig33842796104733"></a><a name="en-us_topic_0077171435_en-us_topic_0077171435_fig33842796104733"></a><span class="figcap"><b>Figure 7 </b>Checking whether the software repository has been enabled</span><br><span><img id="sfs_01_0027__en-us_topic_0077171435_image2230840711443" src="en-us_image_0000001567396709.png"></span></div>
|
|
</div>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="sfs_01_0027__section16938692113347"><h4 class="sectiontitle">Ubuntu</h4><ol id="sfs_01_0027__ol321682511344"><li id="sfs_01_0027__li5342128111344"><span>Run the following command to add a software repository.</span><p><div class="p" id="sfs_01_0027__p60451486113545"><strong id="sfs_01_0027__b7192463113545">apt-add-repository http://archive.canonical.com/ubuntu</strong><div class="fignone" id="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig18983675112352"><span class="figcap"><b>Figure 8 </b>Adding a software repository</span><br><span><img id="sfs_01_0027__image46753030113640" src="en-us_image_0000001567316453.png"></span></div>
|
|
</div>
|
|
</p></li><li id="sfs_01_0027__li11378450113434"><span>Run the following command to update and add software repositories.</span><p><p id="sfs_01_0027__en-us_topic_0077171435_p45571175113234"><strong id="sfs_01_0027__en-us_topic_0077171435_b7487395113234">apt-get update</strong></p>
|
|
<div class="fignone" id="sfs_01_0027__en-us_topic_0077171435_en-us_topic_0077171435_fig1390229711259"><span class="figcap"><b>Figure 9 </b>Updating and adding repositories</span><br><span><img id="sfs_01_0027__image2171857211379" src="en-us_image_0000001515917372.png"></span></div>
|
|
</p></li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="sfs_01_0107.html">Getting Started</a></div>
|
|
</div>
|
|
</div>
|
|
|