当前位置: 首页 > 工具软件 > openSUSE > 使用案例 >

opensuse15.3 基本操作

冯枫涟
2023-12-01
静态IP配置
vim /etc/sysconfig/network/ifcfg-eth0

IPADDR='172.24.0.101/24'
BOOTPROTO='static'
STARTMODE='auto'

路由配置

vim /etc/sysconfig/network/ifroute-eth0

default 172.24.0.1 --

DNS配置

vim /etc/sysconfig/network/config

NETCONFIG_DNS_STATIC_SERVERS="114.114.114.114 8.8.8.8"
搜索软件
zypper search package

安装软件
zypper install package

安装某个版本的软件包
zypper install package=version

安装以某个单词名字开头的所有软件包
zypper install package*

卸载某个软件包
zypper remove package

升级某个软件包
zypper update package

获取所有可用新包的列表
zypper list-updates

检验软件包的依赖关系的完整性
zypper verify package

执行系统升级
zypper dist-upgrade

执行源代码软件安装和其依赖
zypper source-install package.tgz

配置源仓库

首先禁用默认软件源
zypper mr -da

添加源

zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.3/repo/oss openSUSE-Aliyun-OSS
zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.3/repo/non-oss openSUSE-Aliyun-NON-OSS
zypper ar -fc https://mirrors.aliyun.com/opensuse/update/leap/15.3/oss openSUSE-Aliyun-UPDATE-OSS
zypper ar -fc https://mirrors.aliyun.com/opensuse/update/leap/15.3/non-oss openSUSE-Aliyun-UPDATE-NON-OSS

#刷新

zypper ref
zypper repos --details查看源配置:
node16:/etc/sysconfig/network # zypper repos --details
#  | Alias                          | Name                                                                 | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                                  | Service
---+--------------------------------+----------------------------------------------------------------------+---------+-----------+---------+----------+--------+--------------------------------------------------------------------------------------+--------
 1 | openSUSE-Aliyun-NON-OSS        | openSUSE-Aliyun-NON-OSS                                              | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://mirrors.aliyun.com/opensuse/distribution/leap/15.3/repo/non-oss              | 
 2 | openSUSE-Aliyun-OSS            | openSUSE-Aliyun-OSS                                                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://mirrors.aliyun.com/opensuse/distribution/leap/15.3/repo/oss                  | 
 3 | openSUSE-Aliyun-UPDATE-NON-OSS | openSUSE-Aliyun-UPDATE-NON-OSS                                       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://mirrors.aliyun.com/opensuse/update/leap/15.3/non-oss                         | 
 4 | openSUSE-Aliyun-UPDATE-OSS     | openSUSE-Aliyun-UPDATE-OSS                                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | https://mirrors.aliyun.com/opensuse/update/leap/15.3/oss                             | 
 5 | openSUSE-Leap-15.3-2           | openSUSE-Leap-15.3-2                                                 | No      | ----      | ----    |   99     | rpm-md | cd:/?devices=/dev/disk/by-id/ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 | 
 6 | repo-backports-debug-update    | Update repository of openSUSE Backports (Debug)                      | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/update/leap/15.3/backports_debug/                       | 
 7 | repo-backports-update          | Update repository of openSUSE Backports                              | No      | ----      | ----    |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/backports/                             | 
 8 | repo-debug                     | Debug Repository                                                     | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/15.3/repo/oss/                  | 
 9 | repo-debug-non-oss             | Debug Repository (Non-OSS)                                           | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/15.3/repo/non-oss/  

禁用原来无效的源

zypper modifyrepo -d 1

刷新生效

zypper refresh
 类似资料: