VM虚拟机安装 CentOS 7.6 部署宝塔面板实操

news2024/10/9 2:04:30

一、centos下载


进入centos官网下载页面,选择7.6版本,依次点击 tree-》isos-》x86_64/-》CentOS-7-x86_64-DVD-1810.iso 进行下载。


centos官网下载页面:

https://wiki.centos.org/Download.html

1、打开下载页面

在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


在这里插入图片描述


二、配置CentOS 7的网络

1、在终端中输入以下命令,查看安装在本机的网卡

nmcli d

显示信息如下:

DEVICE      TYPE      STATE      CONNECTION 
ens33       ethernet  connected  ens33      
virbr0      bridge    connected  virbr0     
lo          loopback  unmanaged  --         
virbr0-nic  tun       unmanaged  --   

2、切换到/etc/sysconfig/network-scripts/目录下

cd /etc/sysconfig/network-scripts/
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ls
ifcfg-ens33  ifdown-ib    ifdown-ppp       ifdown-tunnel  ifup-ib    ifup-plusb   ifup-Team         network-functions
ifcfg-lo     ifdown-ippp  ifdown-routes    ifup           ifup-ippp  ifup-post    ifup-TeamPort     network-functions-ipv6
ifdown       ifdown-ipv6  ifdown-sit       ifup-aliases   ifup-ipv6  ifup-ppp     ifup-tunnel
ifdown-bnep  ifdown-isdn  ifdown-Team      ifup-bnep      ifup-isdn  ifup-routes  ifup-wireless
ifdown-eth   ifdown-post  ifdown-TeamPort  ifup-eth       ifup-plip  ifup-sit     init.ipv6-global
[root@localhost network-scripts]# 


3、打开 ifcfg-ens33 文件

vim ifcfg-ens33

打开后内容如下:

TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="db61f3ee-c8dc-43a8-8c41-df1f6147ffb0"
DEVICE="ens33"
ONBOOT="yes"
~              

修改为以下内容

BOOTPROTO=dhcp

ONBOOT=yes

保存 ,并重启网络

systemctl restart network 

4、打开DNS 配置

cd /etc/

打开 resolv.conf

vim resolv.conf

修改nameserver 改为 8.8.8.8 或者 114.114.114.114

# Generated by NetworkManager
search localdomain
nameserver  8.8.8.8
nameserver  114.114.114.114

重启网卡:

systemctl restart network

三、安装宝塔


1、执行命令安装宝塔

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

2、错误提示 :

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; Unknown error"


 One of the configured repositories failed (Unknown),
 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


解决方法:

3 、yum更换源

(1)、先备份,yum源目录为 /etc/yum.repos.d/

 cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.backup

(2)、下载阿里云的yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2024-10-01 00:52:36--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 61.174.8.44, 61.174.8.39, 61.174.8.43, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|61.174.8.44|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[==================================================================================>] 2,523       --.-K/s   in 0.001s  

2024-10-01 00:52:38 (4.26 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]

(3)、生成缓存

yum makecache
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                 | 3.6 kB  00:00:00     
extras                                                                                               | 2.9 kB  00:00:00     
updates                                                                                              | 2.9 kB  00:00:00     
(1/10): base/7/x86_64/group_gz                                                                       | 153 kB  00:00:02     
(2/10): base/7/x86_64/other_db                                                                       | 2.6 MB  00:00:02     
(3/10): extras/7/x86_64/other_db                                                                     | 154 kB  00:00:00     
(4/10): extras/7/x86_64/filelists_db                                                                 | 305 kB  00:00:02     
(5/10): updates/7/x86_64/filelists_db                                                                |  15 MB  00:00:00     
(6/10): updates/7/x86_64/other_db                                                                    | 1.6 MB  00:00:00     
(7/10): updates/7/x86_64/primary_db                                                                  |  27 MB  00:00:00     
base/7/x86_64/primary_db       FAILED                                          
http://mirrors.cloud.aliyuncs.com/centos/7/os/x86_64/repodata/6d0c3a488c282fe537794b5946b01e28c7f44db79097bb06826e1c0c88bad5ef-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.cloud.aliyuncs.com:80; Connection refused"
Trying other mirror.
base/7/x86_64/filelists_db     FAILED                                          
http://mirrors.aliyuncs.com/centos/7/os/x86_64/repodata/d6d94c7d406fe7ad4902a97104b39a0d8299451832a97f31d71653ba982c955b-filelists.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
(8/10): base/7/x86_64/primary_db                                                                     | 6.1 MB  00:00:00     
extras/7/x86_64/primary_db     FAILED                                          ======     ] 482 kB/s |  53 MB  00:00:15 ETA 
http://mirrors.aliyuncs.com/centos/7/extras/x86_64/repodata/e12dbf10e94bc2b33b1f45e026559bc8685728b139dddae0654d96bc624c5602-primary.sqlite.bz2: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
(9/10): extras/7/x86_64/primary_db                                                                   | 253 kB  00:00:00     
(10/10): base/7/x86_64/filelists_db                                                                  | 7.2 MB  00:00:02     
Metadata Cache Created

(4)、更新系统

yum -y update

等待更新完成

(5)、运行安装rpel源命令

yum install epel-release
Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                                                                         |  15 kB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                                                                 1/1 
  Verifying  : epel-release-7-11.noarch                                                                                 1/1 

Installed:
  epel-release.noarch 0:7-11                                                                                                

Complete!




安装完成之后就可以直接使用yum来安装额外的软件包即可:

yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2197733.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【Java 并发编程】多线程安全问题(上)

前言 虽然并发编程让我们的 CPU 核心能够得到充分的使用&#xff0c;程序运行效率更高效。但是也会引发一些问题。比如当进程中有多个并发线程进入一个重要数据的代码块时&#xff0c;在修改数据的过程中&#xff0c;很有可能引发线程安全问题&#xff0c;从而造成数据异常。 p…

可视化-最小二乘法拟合直线

目录 1、最小二乘法拟合直线 2、需要用到的公式 3、计算各个参数 &#xff0c;得到函数表达式 4、可视化-绘画图像 1、最小二乘法拟合直线 double x[15] {29,34,39,44,49,54,59,64,69,74,79,84,89,94,99}; double y[15] { 0.2989,0.3036,0.3084,0.3133,0.3182,0.3231,0.…

【HTML并不简单】笔记3-你不知道的列表元素和html、body

文章目录 无序列表menuol的其他属性typestart和valuereversed 定义列表dl、dt、ddhtml与body关联性overflow 桌面端和移动端的滚动条 《HTML并不简单&#xff1a;Web前端开发精进秘籍》张鑫旭 笔记 无序列表menu <menu>元素可以看成是<ul>元素的平行替代&#xff…

生成正激波表的代码

k1.4 import math import numpy as np import pandas as pd #Ma1到p之比 def Ma2p(Ma1,k):return 2*k*Ma1**2/(k1)-(k-1)/(k1) def Ma2rho(Ma1,k):return (k1)*Ma1**2/(2(k-1)*Ma1**2) def Ma2T(Ma1,k):return 1/Ma1**2*(2/(k1))**2*(k*Ma1**2-(k-1)/2)*(1(k-1)/2*Ma1**2) def…

【陪诊系统】打包问题

使用vite打包后&#xff0c;点击打开index.html是空白的&#xff0c;然后查阅了一些资料&#xff0c;原来是路径问题 【解决办法】&#xff1a;在vite.config.js中去添加base:‘./’ ok,完美解决&#xff0c;再打开打包好后的index.html可以看到界面了

CoppeliaSim和Matlab建立远程连接教程

CoppeliaSim和Matlab建立远程连接教程 Matlab通过调用CoppeliaSim的远程API和库函数实现远程连接,为实现Matlab和CoppeliaSim的联合仿真做准备。 一、获取并查看版本信息 点击 Help 查看版本信息 使用的CoppeliaSim Edu版本为:4.4.0 位数:64bit 二、拷贝API函数和库文件…

Ngx+Lua+Redis 实时IP黑名单系统

实时黑名单系统&#xff0c;如果用php脚本实现很容易&#xff0c;但是效率惨不忍睹呀。 要想速度快还的在nginx层实现阻塞。如果iptables 层阻塞速度更快&#xff0c;但是黑名单列表如果有更新就必须要重载配置&#xff0c;实现还是有难度的。php管理后台把黑名单ip写入到redis…

【数据分享】全国地级市2000-2022年公路里程数据(Shp/Excel格式)

公路里程是表征城市建设的重要指标&#xff01;我们发现在各省市统计年鉴、经济社会发展统计中有公路里程数据&#xff0c;例如下图为2022年南京统计年鉴中统计的2021年和2020年的南京市公路里程数据&#xff1a; 我们特地从2001-2023年各省级/市级年鉴中汇总整理了全国地级市的…

PCL 将点云的曲率数据保存至txt

目录 一、概述 1.1原理 1.2实现步骤 1.3应用场景 二、代码实现 2.1关键函数 2.1.1 计算点云曲率 2.1.2 将曲率保存到txt文件 2.2完整代码 三、实现效果 PCL点云算法汇总及实战案例汇总的目录地址链接&#xff1a; PCL点云算法与项目实战案例汇总&#xff08;长期更新…

【论文速看】DL最新进展20241008-多模态、医学图像分割、扩散模型

目录 【多模态】【医学图像分割】【扩散模型】 【多模态】 PaliGemma: A versatile 3B VLM for transfer 研究机构&#xff1a;google 论文链接&#xff1a;https://arxiv.org/pdf/2407.07726 模型及其说明链接&#xff1a;https://huggingface.co/google/paligemma-3b-pt-22…

leetcode68:文本左右对齐

给定一个单词数组 words 和一个长度 maxWidth &#xff0c;重新排版单词&#xff0c;使其成为每行恰好有 maxWidth 个字符&#xff0c;且左右两端对齐的文本。 你应该使用 “贪心算法” 来放置给定的单词&#xff1b;也就是说&#xff0c;尽可能多地往每行中放置单词。必要时可…

RWKV-7 预览版、大量新论文...RWKV 社区 9 月动态速览

欢迎大家收看《RWKV 社区最新动态》第五期&#xff0c;本期内容收录了 RWKV 社区 2024 年 9 月的最新动态。 9 月动态省流版&#xff08;TL;DR&#xff09; RWKV 官方新闻动态 RWKV-7 发布预览版RWKV-7 论文撰写已面向社区开放RWKV 官网上线 Bad Case 收集页面RWKV 中文文档已…

攻防世界---->sherlock

做题笔记。 下载。 单词中出现大写很可疑。因为大写最多出现在开头等。 猜测是隐写术。 进行筛选。 借助python实现 with open(C:\\Users\\Acer\\Downloads\\f590c0f99c014b01a5ab8b611b46c57c.txt, r) as file:text file.read() uppercase_letters [char for char in text…

手撕数据结构 —— 顺序表(C语言讲解)

目录 1.顺序表简介 什么是顺序表 顺序表的分类 2.顺序表的实现 SeqList.h中接口总览 具体实现 顺序表的定义 顺序表的初始化 顺序表的销毁 打印顺序表 ​编辑 检查顺序表的容量 尾插 尾删 ​编辑 头插 头删 查找 在pos位置插入元素 删除pos位置的值 ​…

内核驱动-如何编译内核以及给内核中添加新文件

1.编译内核 想要编译内核&#xff0c;首先需要先下载内核源代码。可以在官方网站下载源代码压缩包&#xff0c;然后放在Ubuntu的目录下&#xff0c;然后解压&#xff08;解压的指令为&#xff1a;sudo tar -xvf xxxx.gz&#xff09;。解压之后在当前目录下可以看到解压之后的文…

java8 双冒号(::)使用方法

双冒号&#xff08;::&#xff09;运算符是跟函数式接口相关的运算符&#xff0c;作为函数式接口的赋值操作。 双冒号用于静态方法 使用方法&#xff1a;将类的静态方法赋值给一个函数式接口&#xff0c;静态方法的参数个数、类型要跟函数式的接口一致。调用这个函数式接口就…

数字化转型:别让技术迷了眼,战略觉醒才是关键。新媒体营销大客户销售AIGC大模型创新思维专家培训讲师谈数字化转型商业模式短视频内容社私域数字经济人工智能

​数字化转型从根本上讲不是关于技术,而是关于战略。 数字化转型使用新的数字技术来实现重大的业务改进,如增强客户体验、精简运营或创建新的商业模式。数字化转型描述了一家公司试图为数字时代做好准备的旅程。 数字化转型不是关于技术或获取新的技术技能。事实上,它是关于获得…

永磁同步电机环路反步法(backstepping)控制

文章目录 1、反步控制原理1.1 李雅普诺夫稳定性定理1.2 严格反馈系统1.3 一般设计流程 2、永磁同步电机反步控制2.1 反步控制器设计2.2 反步控制仿真 参考 写在前面&#xff1a;本人能力、时间、技术有限&#xff0c;没有对一些细节进行深入研究和分析&#xff0c;也难免有不足…

简易CPU设计入门:取指令(四)

项目代码下载 还是请大家首先准备好本项目所用的源代码。如果已经下载了&#xff0c;那就不用重复下载了。如果还没有下载&#xff0c;那么&#xff0c;请大家点击下方链接&#xff0c;来了解下载本项目的CPU源代码的方法。 下载本项目代码 准备好了项目源代码以后&#xff…

SOMEIP_ETS_174: SD_Unknown_Option_type

测试目的&#xff1a; 验证DUT能够拒绝一个引用了未知选项类型的SubscribeEventgroup消息&#xff0c;并以SubscribeEventgroupNAck作为响应。 描述 本测试用例旨在确保DUT遵循SOME/IP协议&#xff0c;当接收到一个引用了未知选项类型的SubscribeEventgroup消息时&#xff0…