Solve the problem that Linux encounters There are no enabled repos.

Problem Description

When installing FastDFS( yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim -y) on the Linux server , the installation fails, prompting yum repolist all.
Insert picture description here
Following the prompt, I tried to type yum repolist all, but it was displayed 0.
Insert picture description here
So go back to the first picture, this hint There are no enabled repos..
Blindly guess whether there is no installation wgetsource?
Knock wget _vdetect what version to try
Insert picture description here
Dude, you really have not installed wget...

solve

The following is a demonstration for two servers with different Linux versions.

  • CentOS
  • Ubuntu

I do not know what the server version of Linux, you can use lsb_release -ato view specific information about the current version of the Linux distribution
Insert picture description here

1. CentOS

According to Netease's "CentOS mirrors Using Help": http: //mirrors.163.com/.help/centos.html

  1. Backup first/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

If can not find the yum.repos.dfolder, mkdircreate a
mkdir /etc/yum.repos.dcan

  1. Download the corresponding version of the repo file and put it in /etc/yum.repos.d/ (please make a corresponding backup before operation, if any)

Use to lsview the file:
Insert picture description here

  1. Run the following command to generate the cache
# 清除缓存
yum clean all
# 生成缓存
yum makecache
  1. installationwget
yum install wget

2. Ubuntu

Insert picture description here

The reason Ubuntudoes not support the yumdownload and installation mechanism

It should apt-getbe installed separately using the package tool:

apt-get install openssl
apt-get install libssl-dev

Guess you like

Origin blog.csdn.net/weixin_43438052/article/details/114273757