"Sudo apt update" can't execute on my Mac mini M1 terminal

i have problem in mac m1 terminal , i can execute "sudo apt update" the error is :

The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt. Please visit http://www.java.com for information on installing Java.


Java environment is done to setup , any idea to solve this problem?

Posted on Dec 9, 2021 9:08 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 9, 2021 9:40 PM

Hmm. The apt commands are not a native in macOS, and is typically used with several Linux variations. Mac users that have a need to use this command rely on something like HomeBrew or MacPorts. I don't believe the M1 Macs changed this.

Similar questions

2 replies

Dec 9, 2021 9:25 PM in response to lukman_LKS

Related Article Said:

"'Sudo apt update' can't execute on my Mac mini M1 terminal"

--------


Restore from a Time Machine Backup:

Did you back up your Mac prior to getting this issue? If so, save you data to an external device, and then restore from the backup, seeing if that fixes this. This is a pure example of why to backup your Mac prior to any major change to your system (update being such a change).  How to Use Time Machine: Create a Time Machine backup of your Mac, so that you can have something to restore your Mac from, should anything go wrong with the reinstall.


If that is of no option, then..


Isolate the Issue:

  • Reset the SMC and NVRAM: Restarting your Mac and then reseting your SMC and NVRAM.


  • Create a New Administrator(Go to: System Preferences > Users & Groups).,Sign into it and see if this still occurs. If not, then it is something configured in your current user. So, transfer all your files to the new user, rid of this current user, and use the new user from then on. You should be set to go.


  • Boot into Safe Mode: If of no success, then boot into Safe Mode (Hold Down: Shift key upon boot). Caches and all other unnecessary items are put aside when logging it. So, see if this still occurs.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

"Sudo apt update" can't execute on my Mac mini M1 terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.