Magento2.4: Setup:install command error

ubuntu 22.04 and Magento2.4.3, php7.4
when i try setup:install Command i get following errors, any idea why is this happening?
below is my commands

sudo composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento


sudo php bin/magento setup:install --base-url=http://localhost/magento2/pub/ --db-host=localhost --db-name=magento2 --db-user=magento2 --db-password=Admin@123 --admin-firstname=Admin --admin-lastname=Admin --admin-email=admin@admin.com --admin-user=admin --admin-password=Admin@123 --language=en_US --currency=USD --timezone=America/Chicago --backend-frontname=admin --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=localhost --elasticsearch-port=9200

below are errors

rtrim() expects parameter 1 to be string, bool given#0 /var/www/html/magento2/vendor/magento/framework/Encryption/Adapter/Mcrypt.php(171): rtrim()
#1 /var/www/html/magento2/vendor/magento/framework/Encryption/Encryptor.php(452): MagentoFrameworkEncryptionAdapterMcrypt->decrypt()
#2 /var/www/html/magento2/vendor/magento/module-config/Model/Config/Backend/Encrypted.php(111): MagentoFrameworkEncryptionEncryptor->decrypt()
#3 /var/www/html/magento2/generated/code/Magento/Config/Model/Config/Backend/Encrypted/Interceptor.php(32): MagentoConfigModelConfigBackendEncrypted->processValue()
#4 /var/www/html/magento2/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(133): MagentoConfigModelConfigBackendEncryptedInterceptor->processValue()
#5 /var/www/html/magento2/vendor/magento/framework/App/Config/MetadataConfigTypeProcessor.php(152): MagentoFrameworkAppConfigMetadataConfigTypeProcessor->processScopeData()
#6 /var/www/html/magento2/vendor/magento/framework/App/Config/PostProcessorComposite.php(36): MagentoFrameworkAppConfigMetadataConfigTypeProcessor->process()
#7 /var/www/html/magento2/generated/code/Magento/Framework/App/Config/PostProcessorComposite/Proxy.php(95): MagentoFrameworkAppConfigPostProcessorComposite->process()
#8 /var/www/html/magento2/vendor/magento/module-config/App/Config/Type/System.php(397): MagentoFrameworkAppConfigPostProcessorCompositeProxy->process()
#9 /var/www/html/magento2/vendor/magento/framework/Cache/LockGuardedCacheLoader.php(136): MagentoConfigAppConfigTypeSystem->readData()
#10 /var/www/html/magento2/vendor/magento/module-config/App/Config/Type/System.php(281): MagentoFrameworkCacheLockGuardedCacheLoader->lockedLoadData()
#11 /var/www/html/magento2/vendor/magento/module-config/App/Config/Type/System.php(207): MagentoConfigAppConfigTypeSystem->loadDefaultScopeData()
#12 /var/www/html/magento2/vendor/magento/module-config/App/Config/Type/System.php(181): MagentoConfigAppConfigTypeSystem->getWithParts()
#13 /var/www/html/magento2/vendor/magento/framework/App/Config.php(132): MagentoConfigAppConfigTypeSystem->get()
#14 /var/www/html/magento2/vendor/magento/framework/App/Config.php(80): MagentoFrameworkAppConfig->get()
#15 /var/www/html/magento2/vendor/magento/framework/App/Config.php(93): MagentoFrameworkAppConfig->getValue()
#16 /var/www/html/magento2/vendor/dotmailer/dotmailer-magento2-extension/Setup/UpgradeData.php(400): MagentoFrameworkAppConfig->isSetFlag()
#17 /var/www/html/magento2/vendor/dotmailer/dotmailer-magento2-extension/Setup/UpgradeData.php(170): DotdigitalgroupEmailSetupUpgradeData->upgradeFourFiveTwo()
#18 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(1076): DotdigitalgroupEmailSetupUpgradeData->upgrade()
#19 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(960): MagentoSetupModelInstaller->handleDBSchemaData()
#20 [internal function]: MagentoSetupModelInstaller->installDataFixtures()
#21 /var/www/html/magento2/setup/src/Magento/Setup/Model/Installer.php(389): call_user_func_array()
#22 /var/www/html/magento2/setup/src/Magento/Setup/Console/Command/InstallCommand.php(231): MagentoSetupModelInstaller->install()
#23 /var/www/html/magento2/vendor/symfony/console/Command/Command.php(255): MagentoSetupConsoleCommandInstallCommand->execute()
#24 /var/www/html/magento2/vendor/symfony/console/Application.php(1009): SymfonyComponentConsoleCommandCommand->run()
#25 /var/www/html/magento2/vendor/symfony/console/Application.php(273): SymfonyComponentConsoleApplication->doRunCommand()
#26 /var/www/html/magento2/vendor/magento/framework/Console/Cli.php(115): SymfonyComponentConsoleApplication->doRun()
#27 /var/www/html/magento2/vendor/symfony/console/Application.php(149): MagentoFrameworkConsoleCli->doRun()
#28 /var/www/html/magento2/bin/magento(23): SymfonyComponentConsoleApplication->run()
#29 {main}

and other mid command error

<warning>Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html</warning>
    Authentication required (repo.magento.com):
Downloading https://repo.magento.com/packages.json
<warning>Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html</warning>
    Authentication required (repo.magento.com):
Downloading https://repo.magento.com/packages.json
<warning>Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html</warning>
    Authentication required (repo.magento.com):
Web Setup Wizard installation of "magento/composer-root-update-plugin: 1.1.2" failed.
The helper "question" is not defined.