14下利用代理时yum命令失效难题消除措施

作者: 金沙澳门官网网址  发布:2019-08-22

Fedora 28

错误:

开机自动配置Ip

Error: Cannot retrieve repository metadata (repomd.xml) for repository: updates-released . Please verify its path and try again。

1.设置ip

(1)修改/etc/yum.repos.d下面的Fedora.repo如下:

    1.开发银行网卡:ifconfig eno1 up |ifup eno1

[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=
baseurl=
#mirrorlist=
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

    2.查看eno1状态:ethtool eno1

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
#baseurl=
baseurl=
#mirrorlist=
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

    3.获取网关:route Destination:default Gateway:10.240.176.0

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
#baseurl=
baseurl=
#mirrorlist=
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

    4.安插静态ip:vi /etc/sysconfig/network-scripts/ifcfg-eno1

(2)修改et c/yum.repos.d下面的fedora-updates.repo 如下:

             :/C:Userswuchan4xDocumentsOS issueFedora-infoifcfg-eno1

[updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
#baseurl=
baseurl=
#mirrorlist=
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

2.装置DNS,要不然不可能透过域名访谈地址

[updates-debuginfo]
name=Fedora $releasever - $basearch - Updates - Debug
failovermethod=priority
#baseurl=
baseurl=
#mirrorlist=
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

$ vim /etc/resolv.conf

[updates-source]
name=Fedora $releasever - Updates Source
failovermethod=priority
#baseurl=
baseurl=
#mirrorlist=
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

    C:Userswuchan4xDocumentsOS issueFedora-inforesolv.conf

(3)设置/etc/yum.conf文件,加多本白部分

3.重启网络服务

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
color=never
proxy=    (小编的代理ip和端口号)

service network restart

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

 

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
~   

安装镜像源

(4)设置网卡的域名服务器ifcfg-eth0

vi /etc/yum.repos.d/fedora.repo

vim /etc/sysconfig/network-scripts/ifcfg-eth0

        C:Userswuchan4xDocumentsOS issueFedora-infofedora.repo

DEVICE=eth0
HWADDR=00:18:7D:08:CB:F0
NM_CONTROLLED=yes
ONBOOT=yes
IPADDR=192.168.3.253
BOOTPROTO=none
NETMASK=255.255.255.0
TYPE=Ethernet
GATEWAY=192.168.3.1
IPV6INIT=no
USERCTL=no
PREFIX=24
DNS1=XXX.XXX.XXX.XXX

安顿代理:proxy

接下来就能够#yum install 了~        

1.vim /etc/dnf/dnf.conf (永久)

图片 1

        C:Userswuchan4xDocumentsOS issueFedora-infodnf.conf

2.export http_proxy= (临时)

 

碰着的主题素材:

ping baidu.com没问题,curl 1 重回源代码

dnf -y update

Error: Failed to synchronize cache for repo 'fedora' --不能连特殊的网址

resolve:

1.vim /etc/dnf/dnf.conf

add proxy=

proxy_username=root

proxy_password=tester

2.service network restart

当同临时间张开2个网卡时,ethtool eno1 && eno2 :link yes 会导致心余力绌上网

亟待禁止使用掉二个网卡,ifconfig eno2 down

 

scp传输时如下报错

declare -x FTP_PROXY=''

#vim ~/.bashrc

去除增添的:FTP_PROXY=''

HTTP_PROXY=''

HTTPS_PROXY=''

 

添加ip地址:

ifcfg-eno1

HWADDR=0c:c4:7a:64:96:d6

NAME=enp5s0f0

ONBOOT=yes

TYPE=Ethernet

BOOTPROTO=static

IPADDR=10.240.176.254

NETMASK=255.255.255.128

本文由金沙澳门官网发布于金沙澳门官网网址,转载请注明出处:14下利用代理时yum命令失效难题消除措施

关键词: 金沙澳门官网

上一篇:Ubuntu18.04 安装jdk1.8
下一篇:没有了