How to install packages in fedora-34-cloud-base images, Vagrant, qemu, KVM

I have follow this tutorial to install fedora-34-cloud-base box with vagrant in fedora-34-KDE.

This website says It is a minimal image of fedora.
Now how can we update using sudo dnf up or install a package

This is currently shown in the terminal.

[chris@f34 f34cloud]$ vagrant up
[chris@f34 f34cloud]$ vagrant ssh
[vagrant@fedora ~]$ 
[vagrant@fedora ~]$ uname -a
Linux fedora 5.11.12-300.fc34.x86_64 #1 SMP Wed Apr 7 16:31:13 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@fedora ~]$ 
[vagrant@fedora ~]$ lsblk
vda    252:0    0  41G  0 disk 
└─vda1 252:1    0  40G  0 part /
[vagrant@fedora ~]$ 
[vagrant@fedora ~]$ 
[vagrant@fedora ~]$ 
[vagrant@fedora ~]$ dnf list podman
[vagrant@fedora ~]$ sudo dnf up
[vagrant@fedora ~]$ 

With fedora the update/upgrade is done with
sudo dnf update.
Your command is incomplete.

Also, you need to have communications to the internet from your VM in order to do any updates. Have you verified that you can get to the internet? ping -c 4 should give you a response.

1 Like

the command up is an abbreviation of update, about the f34-cloud-base box does has internet.

[vagrant@fedora ~]$ cat /etc/redhat-release 
Fedora release 34 (Thirty Four)
[vagrant@fedora ~]$ sudo dnf up
Fedora Modular 34 - x86_64 - Updates                 56 kB/s |  40 kB     00:00    
Fedora 34 - x86_64 - Updates                         55 kB/s |  39 kB     00:00    
Fedora 34 - x86_64 - Updates                        1.6 MB/s | 2.9 MB     00:01    
[vagrant@fedora ~]$ ping
PING ( 56(84) bytes of data.
64 bytes from ( icmp_seq=1 ttl=114 time=58.9 ms
64 bytes from ( icmp_seq=2 ttl=114 time=59.2 ms
64 bytes from ( icmp_seq=3 ttl=114 time=57.9 ms
64 bytes from ( icmp_seq=4 ttl=114 time=59.0 ms
64 bytes from ( icmp_seq=5 ttl=114 time=60.3 ms
64 bytes from ( icmp_seq=6 ttl=114 time=58.1 ms
64 bytes from ( icmp_seq=7 ttl=114 time=61.3 ms

64 bytes from ( icmp_seq=8 ttl=114 time=59.1 ms
--- ping statistics ---
8 packets transmitted, 8 received, 0% packet loss, time 7010ms
rtt min/avg/max/mdev = 57.898/59.227/61.276/1.035 ms
[vagrant@fedora ~]$ 

You seem to have both dns and internet connection.

What happens when you do the
sudo dnf update ?
Does it just hang?, error message?, or what?

If it seems to hang and you get no response then it could simply be a timing issue in that you are not waiting long enough.
Recently one user found that he was having a similar issue with certain sites and by disabling ipv6 he eliminated the long time-outs. I cannot seem to find that post right now to reference it.

I am having the exact same issue

PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=114 time=52.6 ms
64 bytes from icmp_seq=2 ttl=114 time=23.1 ms
64 bytes from icmp_seq=3 ttl=114 time=16.7 ms
--- ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 16.725/30.803/52.632/15.649 ms

and I get this output running dnf

[vagrant@fedora ~]$ sudo dnf install vim
Fedora 34 openh264 (From Cisco) - x86_64                                                1.8 kB/s | 2.5 kB     00:01
Fedora Modular 34 - x86_64                                                              1.2 MB/s | 4.9 MB     00:03
Fedora Modular 34 - x86_64 - Updates                                                    1.5 MB/s | 4.2 MB     00:02
Fedora 34 - x86_64 - Updates                                                            2.5 MB/s |  28 MB     00:11
[vagrant@fedora ~]$

NOTE the last line says Killed just like above.

I am running fedora34 as the guest OS as well

with debug output

[root@fedora vagrant]# dnf install vim --debuglevel 5
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, groups-manager, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.6.1
cachedir: /var/cache/dnf
User-Agent: constructed: 'libdnf (Fedora 34; cloud; Linux.x86_64)'
repo: using cache for: fedora-cisco-openh264
fedora-cisco-openh264: using metadata from Tue 23 Feb 2021 12:49:00 AM UTC.
repo: using cache for: fedora-modular
fedora-modular: using metadata from Fri 23 Apr 2021 10:25:38 AM UTC.
repo: using cache for: updates-modular
updates-modular: using metadata from Thu 28 Oct 2021 07:51:12 PM UTC.
repo: using cache for: updates

For both of you, I guess that is an issue that needs to be addressed with the cloud provider that hosts the VMs. It seems they are not allowing an upgrade of fedora and as such are not someone I would do business with.

It may be that you have to make special arrangements for doing upgrades, but the fact that dnf is reporting killed vs waiting to time out is really suspicious.