Foreman upgrade from 3.1 to 3.7

Iam trying to upgrade foreman from 3.1 to 3.7 version.
The Proxy version and core version of foreman does not match.
the Proxy version is 3.7
Core version is 3.1.2.
Can I Upgrade direclty from 3.1 to 3.7???

We don’t test this explicitly, so it’s safer to go each version by version (3.1, 3.2, 3.3, etc up to 3.7).

But if you do want to try out, please do, as long as it’s on EL8 it could work.

I upgraded the foreman using the manual. But in the web interface its showing the old foreman version.
Can you please give me a guide on foreman upgrade.
Thank you.

Well, the documentation is the guide. So if you followed that…

What OS are you running? What are the exact steps you performed for the upgrade?

Iam running Ubuntu 20.04.6 LTS.

  1. I updated the foreman repository /etc/apt/source.list.d/foreman.list
  2. stopped the foreman services
  3. Updated the repository using apt update
  4. Updated the ruby and foreman packages apt-get --only-upgrade install ruby* foreman*
  5. foreman-rake db:migrate
  6. foreman-rake db:seed
  7. foreman-rake tmp:cache:clear
  8. foreman-rake db:sessions:clear
  9. foreman-installer --noop --verbose
  10. foreman-installer
    During foreman-installer there was no error.
    These are the steps performed for upgrade.

Ok, cool. Can you show me the output of the following commands please?

  • apt policy
  • apt policy foreman
  • dpkg -l | grep foreman
  • systemctl status foreman

These are the following output of the following commands.

root@foreman:/home/forema/Desktop# apt policy foreman
  Installed: 3.1.2-1
  Candidate: 3.1.2-1
  Version table:
 *** 3.1.2-1 100
        100 /var/lib/dpkg/status
root@foreman:/home/forema/Desktop# apt policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 focal/puppet6 all Packages
     release o=Puppetlabs,a=focal,n=focal,l=Puppetlabs,c=puppet6,b=all
 500 focal/puppet6 amd64 Packages
root@foreman:/home/forema/Desktop# dpkg -l | grep foreman
ii  foreman                                    3.1.2-1                                                 amd64        Systems management web interface
ii  foreman-cli                                3.1.2-1                                                 all          metapackage providing hammer CLI for Foreman
ii  foreman-debug                              3.1.2-1                                                 all          provides support utility foreman-debug.
ii  foreman-dynflow-sidekiq                    3.1.2-1                                                 all          package providing dynflow sidekiq services for Foreman
ii  foreman-installer                          3.1.2-1                                                 all          Automated puppet-based installer for The Foreman
ii  foreman-postgresql                         3.1.2-1                                                 all          metapackage providing PostgreSQL dependencies for Foreman
ii  foreman-proxy                              9999-3.7.0-focal+scratchbuild+20230309185649+ubuntu2004 all          RESTful proxies for DNS, DHCP, TFTP, and Puppet
ii  foreman-service                            3.1.2-1                                                 all          package providing Foreman services running via puma
ii  ruby-foreman-deface                        1.5.3-1                                                 all          Foreman Deface Plugin Dependency
ii  ruby-foreman-puppet                        2.0.4-1                                                 all          Foreman Puppet Plugin
ii  ruby-foreman-remote-execution              5.0.3-1                                                 all          Foreman Remote Execution Plugin
ii  ruby-foreman-tasks                         5.2.2-2                                                 all          Tasks management engine for Foreman.
ii  ruby-hammer-cli-foreman                    3.1.0-1                                                 all          Foreman commands for Hammer
ii  ruby-hammer-cli-foreman-puppet             0.0.4-1                                                 all          Foreman Puppet plugin for Hammer CLI
root@foreman:/home/forema/Desktop# systemctl status foreman
● foreman.service - Foreman
     Loaded: loaded (/lib/systemd/system/foreman.service; enabled; vendor pres>
    Drop-In: /etc/systemd/system/foreman.service.d
     Active: active (running) since Tue 2023-11-28 11:59:58 IST; 2 days ago
TriggeredBy: ● foreman.socket
   Main PID: 1053 (foreman-ruby)
      Tasks: 113 (limit: 19082)
     Memory: 2.6G
     CGroup: /system.slice/foreman.service
             ├─1053 puma 5.6.2 (unix:///run/foreman.sock) [foreman]
             ├─1852 puma: cluster worker 0: 1053 [foreman]
             ├─1854 puma: cluster worker 1: 1053 [foreman]
             ├─1856 puma: cluster worker 2: 1053 [foreman]
             ├─1857 puma: cluster worker 3: 1053 [foreman]
             ├─1858 puma: cluster worker 4: 1053 [foreman]
             └─1860 puma: cluster worker 5: 1053 [foreman]

Nov 30 09:52:11 foreman[1852]: /usr/share/foreman/lib/proxy>
Nov 30 09:52:11 foreman[1858]: /usr/share/foreman/lib/proxy>

lines 1-28


Couple of observations that explain your current situation:

This indicates (if the output is not cut of or anything) that the only remote repository apt knows is the Puppet one. Which in turn means there is no repository you would be getting Foreman (or Ubuntu!) updates from.
Can you you show the output of grep -r "" /etc/apt/sources.list*?

3.1.2 is the only Foreman version known to apt right now, so no update possible.

This is a scratch build, that should not exist in a release repository. I wonder where this comes from?
Given this is the only 3.7 package, it must have came to the system by some other means than the regular update process.

The output of grep -r "" /etc/apt/sources.list* are as follows

/etc/apt/sources.list:# See for how to upgrade to
/etc/apt/sources.list:# newer versions of the distribution.
/etc/apt/sources.list:deb focal main restricted
/etc/apt/sources.list:# deb-src focal main restricted
/etc/apt/sources.list:## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
/etc/apt/sources.list:## team. Also, please note that software in universe WILL NOT receive any
/etc/apt/sources.list:## review or updates from the Ubuntu security team.
/etc/apt/sources.list:deb focal universe
/etc/apt/sources.list:# deb-src focal universe
/etc/apt/sources.list:deb focal-updates universe
/etc/apt/sources.list:# deb-src focal-updates universe
/etc/apt/sources.list:## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
/etc/apt/sources.list:## team, and may not be under a free licence. Please satisfy yourself as to
/etc/apt/sources.list:## your rights to use the software. Also, please note that software in
/etc/apt/sources.list:## multiverse WILL NOT receive any review or updates from the Ubuntu
/etc/apt/sources.list:## security team.
/etc/apt/sources.list:deb focal multiverse
/etc/apt/sources.list:# deb-src focal multiverse
/etc/apt/sources.list:deb focal-updates multiverse
/etc/apt/sources.list:# deb-src focal-updates multiverse
/etc/apt/sources.list:## N.B. software from this repository may not have been tested as
/etc/apt/sources.list:## extensively as that contained in the main release, although it includes
/etc/apt/sources.list:## newer versions of some applications which may provide useful features.
/etc/apt/sources.list:## Also, please note that software in backports WILL NOT receive any review
/etc/apt/sources.list:## or updates from the Ubuntu security team.
/etc/apt/sources.list:deb focal-backports main restricted universe multiverse
/etc/apt/sources.list:# deb-src focal-backports main restricted universe multiverse
/etc/apt/sources.list:## Uncomment the following two lines to add software from Canonical's
/etc/apt/sources.list:## 'partner' repository.
/etc/apt/sources.list:## This software is not part of Ubuntu, but is offered by Canonical and the
/etc/apt/sources.list:## respective vendors as a service to Ubuntu users.
/etc/apt/sources.list:# deb focal partner
/etc/apt/sources.list:# deb-src focal partner
/etc/apt/sources.list:deb focal-security main restricted

These are the results can you show me the steps to update the foreman repository in apt??
Thank you…

Can anyone Help me in this topic.
I am desperate…
Thank you.

So it looks like you just don’t have any repos for Foreman defined right now.
And without the repos, you won’t be getting any updates.

Can you please ensure you have a /etc/apt/sources.list.d/foreman.list with the right content as described in the upgrade docs:

deb bullseye 3.7
deb plugins 3.7

and you have the signing key present:

# wget -O /etc/apt/trusted.gpg.d/foreman.asc

after that, please run apt update and post the output here so we can check if it pulls down the repository metadata correctly and everything