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


一、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=dhcpONBOOT=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 onlysafe 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 workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=<repoid> ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable <repoid>orsubscription-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 muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=trueCannot 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 transactionInstalling : 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.xdnf.cn/news/1558000.html

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

相关文章

opencv学习:图像拼接及完整代码实现

概念 图像拼接是计算机视觉领域中的一项技术&#xff0c;它涉及将多个图像合并成一个连续的、无缝的全景图像。在OpenCV中&#xff0c;图像拼接通常包括以下几个关键步骤&#xff1a; 1. 编写代码 导入必要的库&#xff1a;导入sys、cv2和numpy库。定义显示图像的函数&#x…

算法灰度膨胀腐蚀算子优化方法

第1章 当前灰度膨胀腐蚀算子 图像最大值最小值滤波。效果如下: 1.1. 常规实现 1.1.1. 半径范围遍历 对于一个像素,其膨胀腐蚀结果,查看周围半径范围内的所有像素,取最大最小值。 uint8_t nMax = 0; for (int j = -nRY; j <= nRY; j++) {for (int i = -nRX; i <= …

《重生到现代之从零开始的C语言生活》—— 联合体和枚举

联合体 像结构体一样&#xff0c;联合体也是由一个或多个成员构成 但是只会给最大的成员分配内存&#xff0c;联合体的特点就是所有成员共用一块内存空间&#xff0c;所以也叫共同体 由于所有的成员共用一块内存空间&#xff0c;所以如果给其中的一个成员赋值的话&#xff0…

Ubuntu修改IP方法

方法一&#xff1a;通过图形化界面修改IP 打开网络设置&#xff1a; 点击桌面右上角的网络图标&#xff0c;然后选择“设置”或“网络设置”。 选择网络接口&#xff1a; 在网络设置窗口中&#xff0c;选择你正在使用的网络接口&#xff08;有线或无线网络&#xff09;。 进…

避雷!Google Adsense联盟营销七大投放误区

你是否在使用Google AdSense进行广告投放&#xff1f;你是否想进一步优化你的投放策略&#xff1f;那么这篇文章你不可错过啦&#xff01; Google AdSense为跨境商家提供了一个平台&#xff0c;我们可以通过展示相关广告来赚取收入。然而&#xff0c;即使是最有经验的商家也可…

ReentrantLock相关知识

加锁流程 公平锁加锁流程&#xff1a; public final void acquire(int arg) {if (!tryAcquire(arg) &&acquireQueued(addWaiter(Node.EXCLUSIVE), arg))selfInterrupt(); } 加锁流程主要分三大步&#xff1a; tryAcquire尝试获取锁 protected final boolean tryAc…

C++nullptr

其实理解nullptr很简单&#xff0c;它其实就是将一个指针置为空 int* arrnullptr; 但是为什么C语言明明有NULL可以将指针置为空&#xff0c;C还要引入nullptr呢 其实简单理解C语言的NULL它其实是一个宏 #ifndef NULL #ifdef __cplusplus #define NULL 0 #else #define NUL…

【Agent】Cognitive Architectures for Language Agents

arxiv: https://arxiv.org/abs/2309.02427 背景 现有的Agent框架&#xff0c;大部分是基于强化学习提出的框架。本文结合生产系统和认知科学&#xff0c;提出了一个结构化和模块化的Agent架构。 2、记忆 记忆可分为两类&#xff1a; 工作记忆&#xff08;短期记忆&#xf…

多线程股吧(东方财富)用户信息爬取

多线程东方财富&#xff08;股吧&#xff09;用户信息爬取 在上一篇博客股吧信息爬取的基础上加入了多线程&#xff0c;使得速度提升了十几倍&#xff0c;爬取内容如下&#xff1a; 最终爬取结果如下&#xff1a; 完整代码如下&#xff08;准备好环境&#xff0c;比如pytho…

近年来自动驾驶行业就业与企业需求情况

自动驾驶行业在近年来持续发展&#xff0c;就业情况和企业需求呈现出多样化和复杂化的趋势。 以下是基于我搜索到的资料对自动驾驶行业最新就业情况和企业需求的详细分析&#xff1a; 自动驾驶行业对高端技术人才的需求非常旺盛&#xff0c;尤其是架构工程师、算法工程师等岗…

Qt(10.8)

作业&#xff1a;完善登录界面 源文件 #include "widget.h" #include "ui_widget.h" #include<QDebug> #include<QLabel> #include<QMessageBox> Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget) {ui->setu…

【C++篇】继承之韵:解构编程奥义,领略面向对象的至高法则

文章目录 C 继承详解&#xff1a;初阶理解与实战应用前言第一章&#xff1a;继承的基本概念与定义1.1 继承的概念1.2 继承的定义 第二章&#xff1a;继承中的访问权限2.1 基类成员在派生类中的访问权限2.2 基类与派生类对象的赋值转换2.2.1 派生类对象赋值给基类对象2.2.2 基类…

leetcode68:文本左右对齐

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

Ubuntu 22.04 安装 KVM

首先检查是否支持 CPU 虚拟化&#xff0c;现在的 CPU 都应该支持&#xff0c;运行下面的命令&#xff0c;大于0 就是支持。 egrep -c (vmx|svm) /proc/cpuinfo安装 Libvirt apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-uti…

DAMA数据管理知识体系(第11章 数据仓库和商务智能)

课本内容 11.1 引言 概要 数据仓库被公认为企业数据管理的核心语境关系图 图11-1 语境关系图&#xff1a;数据仓库和商务智能业务驱动因素 运营支持职能合规需求商务智能活动目标和原则 目标 一个组织建设数据仓库的目标通常有&#xff1a; 1&#xff09;支持商务智能活动。 2&…

易图讯军用VR三维电子沙盘系统

深圳易图讯军用VR三维电子沙盘系统是一种集成了虚拟现实&#xff08;VR&#xff09;技术、三维建模技术、大数据分析、实时动态更新以及高度安全可靠的综合性军事指挥平台。该系统通过高精度三维模型真实再现战场环境&#xff0c;为指挥员提供沉浸式体验和交互操作的可能性&…

数据结构与算法——Java实现 31.阻塞队列

—— 24.10.8 一、问题提出 目前队列存在的问题 1.很多场景要求分离生产者、消费者两个角色、它们需要由不同的线程来担当&#xff0c;而之前的实现根本没有考虑线程安全问题 2.poll方法&#xff0c;队列为空&#xff0c;那么在之前的实现里会返回null&#xff0c;如果就是硬…

构建MySQL健康检查Web应用

构建MySQL健康检查Web应用 在这里将探讨如何将MySQL健康检查功能转换为一个功能完整的Web应用。这个应用允许用户通过简单的Web界面执行MySQL健康检查&#xff0c;并查看详细的结果。我们将逐步介绍代码实现、改进过程以及如何设置和运行这个应用。 1. MySQL健康检查类 首先…

codetop标签双指针题目大全解析(二),双指针刷穿地心!!!!!

复习比学习更重要&#xff0c;如果忘了就跟没学是一样的 1.和为k的子数组2.统计[优美子数组]3.区间列表的交集4.将x减到0的最小操作5.替换子串得到平衡字符串6.划分字母区间7.分隔链表8.通过删除字母匹配到字典里最长单词9.寻找目标值-二维数组10.至多包含两个不同字符的最长子…

麒麟系统串口配置篇

麒麟系统串口配置篇 1.配置串口驱动&#xff08;编译/动态加载串口&#xff09; 解压文件夹,然后在解压后的文件夹所在目录&#xff0c;右键选择打开终端&#xff0c;依次执行以下命令&#xff1a; 以麒麟系统下的CH341串口驱动为例&#xff0c;解压CH341SER_LINUX.zip sudo…