Linux(Centos7)環(huán)境下在線或離線安裝wget全過程
一、在線安裝wget
使用以下命令查看是否安裝過wget,如果什么不顯示就說明沒有安裝過
rpm -qa | grep wget
以下為wget安裝命令
sudo yum install -y wget
如果顯示以下內(nèi)容時(shí),說明安裝失敗,國外鏡像源封鎖加強(qiáng),需要更換國內(nèi)鏡像源后才能安裝 點(diǎn)擊更改鏡像源
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的錯(cuò)誤"
One of the configured repositories failed (未知),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=<repoid> ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: base/7/x86_64
二、離線安裝wget
1、進(jìn)入wget[下載地址],下載wget的rpm安裝包到本地

2、將下載好的wget文件用Xftp或其他上傳軟件將文件上傳至 /opt下

3、運(yùn)行安裝wget包,并查詢是否安裝成功
rpm -ivh /opt/wget-1.14-10.el7.x86_64.rpm


總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Linux Web服務(wù)器網(wǎng)站故障分析常用命令
這篇文章主要為大家詳細(xì)分析了Linux Web服務(wù)器網(wǎng)站故障,利用常用命令查看故障,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-10-10
CentOS6.5系統(tǒng)簡單安裝與配置Nginx服務(wù)器的方法
這篇文章主要介紹了CentOS6.5系統(tǒng)簡單安裝與配置Nginx服務(wù)器的方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了CentOS6.5平臺安裝及配置nginx服務(wù)器的具體步驟、相關(guān)命令及使用方法,需要的朋友可以參考下2018-04-04
解讀crontab腳本錯(cuò)誤日志和正確的輸出寫入到文件
這篇文章主要介紹了解讀crontab腳本錯(cuò)誤日志和正確的輸出寫入到文件問題,具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-04-04
CentOS7將Nginx添加系統(tǒng)服務(wù)的方法步驟
這篇文章主要介紹了CentOS7將Nginx添加系統(tǒng)服務(wù)的方法步驟,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2019-03-03
CentOS8.1搭建Gitlab服務(wù)器詳細(xì)教程
這篇文章主要介紹了CentOS8.1搭建Gitlab服務(wù)器詳細(xì)教程,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-06-06

