RHEL133 1.Installation

本文档详细介绍了Red Hat Enterprise Linux的安装流程和技术要点,包括系统准备、硬件概述、多系统引导设置等内容。涵盖了从启动系统到完成安装的全过程,并提供了关于文件系统配置、网络设置、软件RAID及LVM等高级功能的说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Initial Installation
        Preparing the Computer
            Boot your system with the Red Hat
             
    Hardware Overview
        Kernel Support
            Core Support:CPU,memory,Process Management,Interrupt/Exception Handling etc.
            Dynamically Loadable Kernel Modules
                Device Drivers
                Additional Functionality:kernel level packet filtering
        User Mode Access to kernel facilities
            System Calls and Signals Like API
            Filesystem Device Nodes
            Network Interfaces
    CPU and Memory
        Seven Supported Architectures:x86,Itanium2,AMD64/EM64T,S/390,zSeries,iSeries,pSeries
        CPU suport on x86
            Technical support for more than 2 physical CPUs only on AS variant(may use Hyper-Threading)
            Up to 32 physical CPUs with SMP or hugemem kernel
        Memory support on x86
            Technical support for more than 16GB on AS or WS
            Standard i686/athlon kernel:4GB
            SMP i686/athlon kernel:16GB
            Hugemem SMP kernel:64GB
    Preparing to Install
        Read the RELEASE-NOTES file on the first setup CD
        Check Hardware Compatibility
            Red Hat Supported Hardware List
                Hardware certified by Red Hat,Hardware Catalog on Red Het Web Site.
            XFree86 supported
    Multiboot system
        GRUB bootloader can coexist with other operating system.
        Two majorissues arise when implementing multiboot systems:
            Partitioning process
            Boot process
    Device Node Examples
        Block Devices
            /dev/hda    -IDE drives,when the system have second IDE drive /dev/hdb
            /dev/sda    -SCSI drives
            /dev/fd0    -standard floppy drives
        Character Devices
            /dev/tty[0-6]    -virtual consoles
            /dev/st0    -SCSI tape drives
        Symbolic links
    The RHEL Installer
    Installer Features
    RHEL Installation Overview
        Language,keyboard and mouse selection
        Media selection if applicable
        Disk partitioning
        Bootloader configuration
        Network and firewall configuration
        Authentication setup
        Package selection
        X server configuration
    Partitioning Hard Drives
        Hard drives are divided into partitions
        Partitions normally contain file systems
            primary,extended,and logical partitions
            The default filesystem type is ext3
        Filesystems are accessed via a mount point, which is a designated directory in  the file system hierarchy
    Sample Partition Struture
       
    Configuring File Systems

    Software RAID
        Redundant Array of Inexpensive Disks
            Multiple Partitions on different disk combined into one RAID device
        Install-time RAID levels:
            RAID0
            RAID1
            RAID5
    LVM:Logical Volume Manager
        IBM system
    Network Configuration
    Firewall Setup
    SELinux:Security Enhanced Linux
        Access control determines what actions processes can perform on what objects
    SELinux Installation Options and Control
        Installation options:
            Disabled
            Warm(Permissive)
            Active(default)(Enforcing)
    Package Selection
    Validating the Installation
    noprobe Mode and Driver Disks
    Post_Install Configuration
        system-config-*  example:system-confgi-date

[root@iZbp1avc1olq9krqsni6tuZ postgres]# sudo yum install -y postgis35_15 Last metadata expiration check: 2:13:26 ago on Mon 23 Jun 2025 11:07:10 AM CST. Error: Problem: cannot install the best candidate for the job - nothing provides geos313 >= 3.13.0 needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides gdal310-libs >= 3.10.0 needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides proj95 >= 9.5.1 needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libjson-c.so.5()(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libgeos_c.so.1()(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libproj.so.25()(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libstdc++.so.6(GLIBCXX_3.4.29)(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libjson-c.so.5(JSONC_0.14)(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides hdf5 needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libSFCGAL.so.2()(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides xerces-c needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libgeotiff17 needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 - nothing provides libgdal.so.36()(64bit) needed by postgis35_15-3.5.2-1PGDG.rhel9.x86_64 from pgdg15 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
06-24
<think>我们已经在阿里云Linux3系统上安装了PostgreSQL15,现在需要安装PostGIS3.5.2扩展。根据引用[1]中的步骤,我们需要从源码编译安装PostGIS。但是,在编译过程中可能会遇到依赖问题(如缺少geos、gdal、proj等)。以下步骤将指导你解决这些依赖问题并成功安装PostGIS。###步骤1:安装编译工具和基础依赖```bashsudoyumgroupinstall"DevelopmentTools"sudoyuminstallwgetunzip```###步骤2:安装PostGIS所需依赖库根据引用[1]和引用[3],我们需要安装以下依赖库:-GEOS(GeometryEngine-OpenSource)-PROJ(坐标投影库)-GDAL(GeospatialDataAbstractionLibrary)-JSON-C-libxml2-protobuf(可选,但PostGIS某些功能需要)####2.1安装GEOS```bash#下载GEOS(注意:PostGIS3.5.2要求GEOS>=3.6,这里安装3.13)wgethttps://download.osgeo.org/geos/geos-3.13.0.tar.bz2tar-xvfgeos-3.13.0.tar.bz2cdgeos-3.13.0./configure--prefix=/usr/localmake-j$(nproc)sudomakeinstall```####2.2安装PROJ```bash#安装PROJ(注意:PostGIS3.5.2要求PROJ>=6.1,这里安装9.5)wgethttps://download.osgeo.org/proj/proj-9.5.0.tar.gztar-xvfproj-9.5.0.tar.gzcdproj-9.5.0./configure--prefix=/usr/localmake-j$(nproc)sudomakeinstall```####2.3安装GDAL```bash#安装GDAL(注意:PostGIS3.5.2要求GDAL>=2.4,这里安装3.10.0)wgethttps://download.osgeo.org/gdal/3.10.0/gdal-3.10.0.tar.gztar-xvfgdal-3.10.0.tar.gzcdgdal-3.10.0./configure--prefix=/usr/localmake-j$(nproc)sudomakeinstall```####2.4安装JSON-C```bashwgethttps://s3.amazonaws.com/json-c_releases/releases/json-c-0.17.tar.gztar-xvfjson-c-0.17.tar.gzcdjson-c-0.17./configure--prefix=/usr/localmakesudomakeinstall```####2.5安装libxml2```bash#下载libxml2(注意版本)wgethttp://xmlsoft.org/sources/libxml2-2.9.12.tar.gztar-xvflibxml2-2.9.12.tar.gzcdlibxml2-2.9.12./configure--prefix=/usr/localmakesudomakeinstall```####2.6安装protobuf-c(如果需要)```bashwgethttps://github.com/protocolbuffers/protobuf/releases/download/v3.15.8/protobuf-cpp-3.15.8.tar.gztar-xvfprotobuf-cpp-3.15.8.tar.gzcdprotobuf-3.15.8./configure--prefix=/usr/localmakesudomakeinstall```###步骤3:配置动态链接库路径```bash#更新动态链接库缓存sudoldconfig```###步骤4:编译安装PostGIS3.5.2```bashwgethttps://download.osgeo.org/postgis/source/postgis-3.5.2.tar.gztar-zxvfpostgis-3.5.2.tar.gzcdpostgis-3.5.2#配置(注意:根据你的PostgreSQL安装路径调整pg_config路径,通常为/usr/pgsql-15/bin/pg_config)./configure\--with-pgconfig=/usr/pgsql-15/bin/pg_config\--with-geosconfig=/usr/local/bin/geos-config\--with-projdir=/usr/local\--with-gdalconfig=/usr/local/bin/gdal-config\--with-jsondir=/usr/local\--with-xml2config=/usr/local/bin/xml2-config\--with-protobufdir=/usr/local#编译并安装makesudomakeinstall```###步骤5:在PostgreSQL中启用PostGIS扩展```bash#切换到postgres用户sudo-iupostgres#连接到你的数据库psql-dyour_database#在数据库内执行CREATEEXTENSIONpostgis;CREATEEXTENSIONpostgis_topology;--可选```###步骤6:验证安装```sqlSELECTPostGIS_Version();```###常见问题解决1.**configure:error:couldnotfindgeos-config**确保GEOS已正确安装,且`geos-config`位于`/usr/local/bin`(或安装路径)并已加入`PATH`。2.**动态库加载失败**运行`sudoldconfig`更新动态链接库缓存。3.**权限问题**如引用[3]所述,如果`makeinstall`时权限不足,可使用`sudo`执行,然后调整目录所有者:```bashsudomakeinstall#假设安装到/usr/local,通常不需要调整,如果安装到其他目录可能需要调整#chown-Rpostgres:postgres/path/to/installation```###相关问题1.如何在PostgreSQL中管理PostGIS扩展的版本升级?2.如何优化PostGIS的空间查询性能?3.在阿里云环境中如何配置PostGIS的高可用架构?4.如何将Shapefile数据导入PostGIS数据库?[^1]:PostGIS官方安装文档[^2]:PostgreSQLRPM仓库的版本命名规范[^3]:阿里云环境下的PostgreSQL服务管理指南</think>### 解决阿里云 Linux3 系统安装 PostGIS 3.5.2 的依赖问题 在阿里云 Linux3 系统上编译安装 PostGIS 3.5.2 for PostgreSQL 15 时,缺少 `geos313`、`gdal310-libs`、`proj95` 等依赖的问题可通过以下步骤解决: --- #### **1. 安装基础编译工具** ```bash sudo yum groupinstall "Development Tools" sudo yum install epel-release wget unzip ``` --- #### **2. 手动编译安装依赖库** > **核心思路**:PostGIS 依赖的空间库需手动编译安装,阿里云官方仓库可能不包含最新版本。 ##### **(1) 安装 GEOS 3.13** ```bash wget https://download.osgeo.org/geos/geos-3.13.0.tar.bz2 tar -xvf geos-3.13.0.tar.bz2 cd geos-3.13.0 ./configure --prefix=/usr/local make -j $(nproc) sudo make install ``` ##### **(2) 安装 PROJ 9.5** ```bash wget https://download.osgeo.org/proj/proj-9.5.0.tar.gz tar -xvf proj-9.5.0.tar.gz cd proj-9.5.0 ./configure --prefix=/usr/local make -j $(nproc) sudo make install ``` ##### **(3) 安装 GDAL 3.10** ```bash wget https://download.osgeo.org/gdal/3.10.0/gdal-3.10.0.tar.gz tar -xvf gdal-3.10.0.tar.gz cd gdal-3.10.0 ./configure --prefix=/usr/local make -j $(nproc) sudo make install ``` ##### **(4) 安装 JSON-C** ```bash wget https://s3.amazonaws.com/json-c_releases/releases/json-c-0.17.tar.gz tar -xvf json-c-0.17.tar.gz cd json-c-0.17 ./configure --prefix=/usr/local make sudo make install ``` --- #### **3. 配置动态链接库** ```bash # 更新库路径 echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/local.conf sudo ldconfig # 验证路径 ldconfig -p | grep -E 'geos|proj|gdal' ``` --- #### **4. 编译安装 PostGIS 3.5.2** ```bash wget https://download.osgeo.org/postgis/source/postgis-3.5.2.tar.gz tar -zxvf postgis-3.5.2.tar.gz cd postgis-3.5.2 # 关键配置(路径需匹配实际安装位置) ./configure \ --with-pgconfig=/usr/pgsql-15/bin/pg_config \ --with-geosconfig=/usr/local/bin/geos-config \ --with-projdir=/usr/local \ --with-gdalconfig=/usr/local/bin/gdal-config \ --with-jsondir=/usr/local \ LDFLAGS="-L/usr/local/lib" \ CPPFLAGS="-I/usr/local/include" make sudo make install ``` --- #### **5. 在 PostgreSQL 中启用扩展** ```bash sudo -iu postgres psql -d your_database # 执行SQL命令 CREATE EXTENSION postgis; SELECT PostGIS_Version(); -- 验证输出应为 "3.5.2" ``` --- #### **故障排除** - **`configure` 报错 "library not found"** 检查 `LDFLAGS` 和 `CPPFLAGS` 路径是否包含 `/usr/local/lib` 和 `/usr/local/include`。 - **`make install` 权限不足** 使用 `sudo` 执行,或参考引用[3]调整目录权限: ```bash sudo chown -R postgres:postgres /usr/pgsql-15/share/extension/ ``` - **运行时加载失败** 确保 PostgreSQL 服务重启前执行 `sudo ldconfig`。 --- #### **验证依赖关系** ```bash # 检查动态库链接 ldd /usr/pgsql-15/lib/postgis-3.so | grep -E 'geos|proj|gdal' # 预期输出示例 libgeos_c.so.1 => /usr/local/lib/libgeos_c.so.1 libproj.so.25 => /usr/local/lib/libproj.so.25 libgdal.so.32 => /usr/local/lib/libgdal.so.32 ``` --- ### **相关问题** 1. 如何在已运行的 PostgreSQL 15 实例中安全升级 PostGIS 版本? 2. PostGIS 空间索引的类型和优化方法有哪些? 3. 如何将 Shapefile 数据高效导入 PostGIS 数据库? 4. 阿里云环境中如何监控 PostGIS 的空间查询性能? > 引用说明: > 依赖库编译步骤参考了 GIS 库的标准安装流程[^1],权限调整方法借鉴了信创云环境中的实践[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值