Trên Fedora CoreOS vẫn có lệnh yum và dnf nhưng bạn sẽ không xài để cài các phần mềm được như trên RHEL và các biến thể như AlmaLinux, Rocky Linux, Oracle Linux, Amazon Linux, VzLinux…
Mình thử cài chương trình soạn thảo văn bản vim bằng yum thì báo lỗi
# yum install vim-enhanced -y
Updating and loading repositories:
Fedora 41 - x86_64 - Updates Archive 100% | 7.8 MiB/s | 20.5 MiB | 00m03s
Fedora 41 openh264 (From Cisco) - x86_64 100% | 1.9 KiB/s | 4.8 KiB | 00m02s
Fedora 41 - x86_64 - Updates 100% | 1.6 MiB/s | 7.5 MiB | 00m05s
Fedora 41 - x86_64 100% | 5.5 MiB/s | 35.4 MiB | 00m06s
Repositories loaded.
Package Arch Version Repository Size
Upgrading:
vim-data noarch 2:9.1.919-1.fc41 updates 18.0 KiB
replacing vim-data noarch 2:9.1.866-1.fc41 <unknown> 18.1 KiB
vim-minimal x86_64 2:9.1.919-1.fc41 updates 1.6 MiB
replacing vim-minimal x86_64 2:9.1.866-1.fc41 <unknown> 1.7 MiB
Installing:
vim-enhanced x86_64 2:9.1.919-1.fc41 updates 4.0 MiB
Installing dependencies:
gpm-libs x86_64 1.20.7-48.fc41 fedora 27.7 KiB
libsodium x86_64 1.0.20-2.fc41 fedora 393.0 KiB
vim-common x86_64 2:9.1.919-1.fc41 updates 37.3 MiB
vim-filesystem noarch 2:9.1.919-1.fc41 updates 40.0 B
xxd x86_64 2:9.1.919-1.fc41 updates 43.8 KiB
Transaction Summary:
Installing: 6 packages
Upgrading: 2 packages
Replacing: 2 package
Total size of inbound packages is 11 MiB. Need to download 11 MiB.
After this operation, 42 MiB extra will be used (install 43 MiB, remove 2 MiB).
[1/8] vim-enhanced-2:9.1.919-1.fc41.x86_64 100% | 1.8 MiB/s | 1.9 MiB | 00m01s
[2/8] gpm-libs-0:1.20.7-48.fc41.x86_64 100% | 8.7 KiB/s | 20.2 KiB | 00m02s
[3/8] vim-filesystem-2:9.1.919-1.fc41.noarch 100% | 52.7 KiB/s | 16.4 KiB | 00m00s
[4/8] vim-common-2:9.1.919-1.fc41.x86_64 100% | 4.6 MiB/s | 8.1 MiB | 00m02s
[5/8] xxd-2:9.1.919-1.fc41.x86_64 100% | 151.3 KiB/s | 34.7 KiB | 00m00s
[6/8] vim-data-2:9.1.919-1.fc41.noarch 100% | 199.9 KiB/s | 21.8 KiB | 00m00s
[7/8] vim-minimal-2:9.1.919-1.fc41.x86_64 100% | 1.9 MiB/s | 802.5 KiB | 00m00s
[8/8] libsodium-0:1.0.20-2.fc41.x86_64 100% | 51.7 KiB/s | 175.7 KiB | 00m03s
---------------------------------------------------------------------------------------------------------------------------------------
[8/8] Total 100% | 2.9 MiB/s | 11.0 MiB | 00m04s
Running transaction
Importing PGP key 0xE99D6AD1:
UserID : "Fedora (41) <fedora-41-primary@fedoraproject.org>"
Fingerprint: 466CF2D8B60BC3057AA9453ED0622462E99D6AD1
From : file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-41-x86_64
Transaction failed: Signature verification failed.
An error occurred importing key "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-41-x86_64": Failed to import public key "file:///etc/pki/rp m-gpg/RPM-GPG-KEY-fedora-41-x86_64" to rpmdb: can't create transaction lock on /usr/share/rpm/.rpm.lock (Read-only file system)
PGP check for package "vim-enhanced-2:9.1.919-1.fc41.x86_64" (/var/cache/libdnf5/updates-e19adde8fd271134/packages/vim-enhanced-9.1.919 -1.fc41.x86_64.rpm) from repo "updates" has failed: Public key import failed.
Tương tự như vậy khi xài dnf để cài chương trình soạn thảo văn bản vim thì cũng bị lỗi y chang như yum.
# dnf install vim-enhanced -y
Updating and loading repositories:
Repositories loaded.
Package Arch Version Repository Size
Upgrading:
vim-data noarch 2:9.1.919-1.fc41 updates 18.0 KiB
replacing vim-data noarch 2:9.1.866-1.fc41 <unknown> 18.1 KiB
vim-minimal x86_64 2:9.1.919-1.fc41 updates 1.6 MiB
replacing vim-minimal x86_64 2:9.1.866-1.fc41 <unknown> 1.7 MiB
Installing:
vim-enhanced x86_64 2:9.1.919-1.fc41 updates 4.0 MiB
Installing dependencies:
gpm-libs x86_64 1.20.7-48.fc41 fedora 27.7 KiB
libsodium x86_64 1.0.20-2.fc41 fedora 393.0 KiB
vim-common x86_64 2:9.1.919-1.fc41 updates 37.3 MiB
vim-filesystem noarch 2:9.1.919-1.fc41 updates 40.0 B
xxd x86_64 2:9.1.919-1.fc41 updates 43.8 KiB
Transaction Summary:
Installing: 6 packages
Upgrading: 2 packages
Replacing: 2 package
Total size of inbound packages is 11 MiB. Need to download 0 B.
After this operation, 42 MiB extra will be used (install 43 MiB, remove 2 MiB).
[1/1] vim-enhanced-2:9.1.919-1.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded
[1/2] gpm-libs-0:1.20.7-48.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
[1/3] libsodium-0:1.0.20-2.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
[1/4] vim-common-2:9.1.919-1.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
[1/5] vim-filesystem-2:9.1.919-1.fc41.noarch 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
[1/6] xxd-2:9.1.919-1.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
[1/7] vim-data-2:9.1.919-1.fc41.noarch 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
[1/8] vim-minimal-2:9.1.919-1.fc41.x86_64 100% | 0.0 B/s | 0.0 B | 00m00s
>>> Already downloaded 100% | 0.0 B/s | 0.0 B | 00m00s
---------------------------------------------------------------------------------------------------------------------------------------
[8/8] Total 100% | 0.0 B/s | 0.0 B | 00m00s
Running transaction
Importing PGP key 0xE99D6AD1:
UserID : "Fedora (41) <fedora-41-primary@fedoraproject.org>"
Fingerprint: 466CF2D8B60BC3057AA9453ED0622462E99D6AD1
From : file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-41-x86_64
Transaction failed: Signature verification failed.
An error occurred importing key "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-41-x86_64": Failed to import public key "file:///etc/pki/rp m-gpg/RPM-GPG-KEY-fedora-41-x86_64" to rpmdb: can't create transaction lock on /usr/share/rpm/.rpm.lock (Read-only file system)
PGP check for package "vim-enhanced-2:9.1.919-1.fc41.x86_64" (/var/cache/libdnf5/updates-e19adde8fd271134/packages/vim-enhanced-9.1.919 -1.fc41.x86_64.rpm) from repo "updates" has failed: Public key import failed.
Do hệ thống quản lí file, Tây gọi là filesystem có thuộc tính là chỉ cho đọc dữ liệu, không cho ghi dữ liệu nên yum và dnf không tạo được file /usr/share/rpm/.rpm.lock, cuối cùng khổ đời cô Lựu roài.
Thật ra yum không phải là lệnh thật sự trên Fedora CoreOS, nó chỉ là 1 liên kết (symbolic link) tới lệnh dnf5 mà thoai. DNF là 1 công cụ mới chạy nhanh hơn YUM, xài ít ram hơn YUM nhưng để các Bash script người ta đã viết ngày xưa bằng yum vẫn chạy được thì chỉ cần 1 lệnh ln để tạo liên kết là xong.
# ll /usr/bin/yum
lrwxrwxrwx. 1 root root 4 Jan 1 1970 /usr/bin/yum -> dnf5
# ll /usr/bin/dnf
lrwxrwxrwx. 1 root root 4 Jan 1 1970 /usr/bin/dnf -> dnf5
# dnf --version
dnf5 version 5.2.7.0
dnf5 plugin API version 2.0
libdnf5 version 5.2.7.0
libdnf5 plugin API version 2.0
Để biết các điểm gắn thiết bị hoặc các hệ thống quản lí file ảo (virtual filesystem) vào cây thư mục của Fedora CoreOS thì coi trong /proc/mounts
# cat /proc/mounts
/dev/nvme0n1p4 /sysroot xfs ro,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,prjquota 0 0
composefs / overlay ro,seclabel,relatime,lowerdir+=/run/ostree/.private/cfsroot-lower,datadir+=/sysroot/ostree/repo/objects,redirect_dir=on,metacopy=on 0 0
/dev/nvme0n1p4 /etc xfs rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,prjquota 0 0
/dev/nvme0n1p4 /sysroot/ostree/deploy/fedora-coreos/var xfs rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,prjquota 0 0
devtmpfs /dev devtmpfs rw,seclabel,nosuid,size=4096k,nr_inodes=481544,mode=755,inode64 0 0
tmpfs /dev/shm tmpfs rw,seclabel,nosuid,nodev,inode64 0 0
devpts /dev/pts devpts rw,seclabel,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
sysfs /sys sysfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0
cgroup2 /sys/fs/cgroup cgroup2 rw,seclabel,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
pstore /sys/fs/pstore pstore rw,seclabel,nosuid,nodev,noexec,relatime 0 0
bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0
configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run tmpfs rw,seclabel,nosuid,nodev,size=790424k,nr_inodes=819200,mode=755,inode64 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,nosuid,noexec,relatime 0 0
systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=37,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12581 0 0
tracefs /sys/kernel/tracing tracefs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
tmpfs /tmp tmpfs rw,seclabel,nosuid,nodev,nr_inodes=1048576,inode64 0 0
hugetlbfs /dev/hugepages hugetlbfs rw,seclabel,nosuid,nodev,relatime,pagesize=2M 0 0
mqueue /dev/mqueue mqueue rw,seclabel,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/credentials/systemd-journald.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/credentials/systemd-udev-load-credentials.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/credentials/systemd-network-generator.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run/credentials/systemd-sysctl.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/credentials/systemd-tmpfiles-setup-dev-early.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/credentials/systemd-tmpfiles-setup-dev.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/credentials/systemd-vconsole-setup.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
/dev/nvme0n1p4 /var xfs rw,seclabel,relatime,attr2,inode64,logbufs=8,logbsize=32k,prjquota 0 0
/dev/nvme0n1p3 /boot ext4 ro,seclabel,nosuid,nodev,relatime 0 0
tmpfs /run/credentials/systemd-tmpfiles-setup.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/credentials/systemd-resolved.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw,relatime 0 0
tmpfs /run/credentials/getty@tty1.service tmpfs ro,seclabel,nosuid,nodev,noexec,relatime,nosymfollow,size=1024k,nr_inodes=1024,mode=700,inode64,noswap 0 0
tmpfs /run/user/1000 tmpfs rw,seclabel,nosuid,nodev,relatime,size=395212k,nr_inodes=98803,mode=700,uid=1000,gid=1000,inode64 0 0
Để cài thêm các gói trong Fedora CoreOS bạn phải xài công cụ rpm-ostree, các gói được cài thêm gọi là extensions.