Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: pkg is not working anymore #10782

Closed
shahriarkabir-sagor opened this issue May 21, 2022 · 10 comments · Fixed by #10783
Closed

[Bug]: pkg is not working anymore #10782

shahriarkabir-sagor opened this issue May 21, 2022 · 10 comments · Fixed by #10783
Labels
bug report Something is not working properly.

Comments

@shahriarkabir-sagor
Copy link

shahriarkabir-sagor commented May 21, 2022

Problem description

when I try to install or update packages using pkg, it show me the following error:-

/data/data/com.termux/files/usr/bin/pkg: line 197: TERMUX_MAIN_PACKAGE_FORMAT: unbound variable

Steps to reproduce the behavior.

All I found in the internet is to use apt instead of pkg.

What is the expected behavior?

It should install or update packages.

System information

  • Termux application version: v0.118
  • Android OS version: 9
  • Device model: Oppo A1k
@shahriarkabir-sagor shahriarkabir-sagor added the bug report Something is not working properly. label May 21, 2022
@Maxython
Copy link
Member

Try reloading termux, that is, close it completely and then open it

@ghost
Copy link

ghost commented May 21, 2022

i have the same error. Even though I completely deleted Termux and downloaded it, it didn't fix it...

@Maxython
Copy link
Member

i have the same error. Even though I completely deleted Termux and downloaded it, it didn't fix it...

You misunderstood!
You don't need to uninstall termux, you just need to restart it for TERMUX_MAIN_PACKAGE_FORMAT to be set.

@ghost
Copy link

ghost commented May 21, 2022

still not working man.

@ghost
Copy link

ghost commented May 21, 2022

Try reloading termux, that is, close it completely and then open it

oh it's working now. but I don't fully understand. I'll let you know once it stops working. good day Sir. :)

@ghost
Copy link

ghost commented May 21, 2022

Termux'u yeniden yüklemeyi deneyin, yani tamamen kapatın ve ardından açın

Nice! it works! I want to be a good programmer like you one day. nice to meet you man. have a nice day. 🥳

@shahriarkabir-sagor
Copy link
Author

Tnx. Restarting Termux solved the problem. But still it's a bug, isn't it?

@2096779623
Copy link
Member

2096779623 commented May 22, 2022

If restarting Termux doesn't fix it, try replacing the login file(You need to install download tools such as wget or curl. Here wget is used as an example):

wget -O /data/data/com.termux/files/usr/bin/login https://raw.githubusercontent.com/termux/termux-packages/master/packages/termux-tools/login

Reopen Termux.

@2096779623
Copy link
Member

2096779623 commented May 22, 2022

Tnx. Restarting Termux solved the problem. But still it's a bug, isn't it?

This bug is the same as libssl.so.3 not found, it can be said that this is not a bug.

@agnostic-apollo agnostic-apollo transferred this issue from termux/termux-app May 22, 2022
agnostic-apollo added a commit to agnostic-apollo/termux-packages that referenced this issue May 22, 2022
…stead of TERMUX_MAIN_PACKAGE_FORMAT

Make changes as per new design implemented in termux/termux-app@b950efec and termux/termux-app#/2740

The package build and termux-tools scripts use current package manager for custom logic. The `termux-tools/termux-setup-package-manager` script has been added that will now be used to provide backward compatibility for termux-app `< 0.119.0` (when its released) and validate the package manager. It will also ensure the variable in not unset to prevent `unbound variable` errors if `set -u` is being used by calling scripts.

Closes termux#10782
agnostic-apollo added a commit to agnostic-apollo/termux-packages that referenced this issue May 22, 2022
…stead of TERMUX_MAIN_PACKAGE_FORMAT

Make changes as per new design implemented in termux/termux-app@b950efec and termux/termux-app#2740

The package build and termux-tools scripts use current package manager for custom logic. The `termux-tools/termux-setup-package-manager` script has been added that will now be used to provide backward compatibility for termux-app `< 0.119.0` (when its released) and validate the package manager. It will also ensure the variable in not unset to prevent `unbound variable` errors if `set -u` is being used by calling scripts.

Closes termux#10782
agnostic-apollo added a commit to agnostic-apollo/termux-packages that referenced this issue May 22, 2022
…stead of TERMUX_MAIN_PACKAGE_FORMAT

Make changes as per new design implemented in termux/termux-app@b950efec and termux/termux-app#2740

The package build and termux-tools scripts use current package manager for custom logic. The `termux-tools/termux-setup-package-manager` script has been added that will now be used to provide backward compatibility for termux-app `< 0.119.0` (when its released) and validate the package manager. It will also ensure the variable in not unset to prevent `unbound variable` errors if `set -u` is being used by calling scripts.

Closes termux#10782
agnostic-apollo added a commit to agnostic-apollo/termux-packages that referenced this issue May 22, 2022
…stead of TERMUX_MAIN_PACKAGE_FORMAT

Make changes as per new design implemented in termux/termux-app@b950efec and termux/termux-app#2740

The package build and termux-tools scripts use current package manager for custom logic. The `termux-tools/termux-setup-package-manager` script has been added that will now be used to provide backward compatibility for termux-app `< 0.119.0` (when its released) and validate the package manager. It will also ensure the variable in not unset to prevent `unbound variable` errors if `set -u` is being used by calling scripts.

Closes termux#10782
@agnostic-apollo
Copy link
Member

The termux-tools v0.180 is out on default repository with the fix and will be available on other mirrors when they sync. Users can switch to default repo with termux-change-repo and can update to it with apt update; apt install termux-tools

https://packages.termux.org/apt/termux-main/pool/main/t/termux-tools/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants