Recently, Xiao Ming just bought a new Mac and wanted to build his own blog website, which requires the Node.js environment. Node.js is installed and managed by Homebrew in MacOS... Therefore, there is the installation process of Homebrew. What is Homebrew? In short, Homebrew is a package management tool for Mac Os, equivalent to yum in Redhat Linux (Centos/RHEL/Fedora) or apt-get in Debian Linux (Debian/Ubuntu). How do I install Homebrew? We use the unified installation method provided by the official website. Just execute the following command /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Ruby is an open source object-oriented programming server-side scripting language that is installed by default on Mac. After a long time, when the prompt **Installation successful!** appears, it means that the installation is successful. If the article ended here, the value of this article would be too low. Next, I will expand on this for you. Problems you may encounter during installation Insufficient read and write permissions When Xiao Ming was installing, he encountered a problem: the following prompt appeared, indicating that the current user permissions were insufficient: touch: /Users/xiaoming/Library/Caches/Homebrew/.cleaned: Permission denied Solution The super administrator (root) needs to grant permissions and execute the following commands: sudo chown -R ${USER} /Users/xiaoming/Library/Caches/Homebrew/ Just enter the password as prompted. The chown command is used by the system administrator (root). Ordinary users do not have the authority to change the owner of other people's files, nor do they have the authority to change the owner of their own files to someone else. Only the system administrator (root) has such permission. Indicates that the root user is used to grant the current user the permission to operate the directory. How to increase the speed of brew installation? After we have successfully installed brew, we can do whatever we want to install the software we want, such as But it seems a bit bad. After executing the command, why is the download and installation speed so touching? Discovering the problem is a good start. Xiao Ming, who has obsessive-compulsive disorder, immediately collected various information on the Internet. While enjoying the benefits of the Internet age, he kept falling into traps. After several downloads, installations and uninstallations, he finally climbed out of the pit successfully. Replace Bottles source By default, the software installed by Homebrew is in the following directories: Cellar means wine cellar or underground cellar, and a software pre-compiled by Homebrew is called a Bottle. Bottles are many wine bottles (i.e. software). Homebrew calls installing a software putting a wine bottle into a wine cellar (underground cellar) (but it is actually pouring, i.e. pouring it into the wine cellar). The official Homebrew software (i.e. Bottles) is placed on the bintray (https://bintray.com/) website. Because it is a foreign website and for well-known reasons, If you download it directly from here, it will be very slow, so we still have to change it to a domestic source (provided by USTC): echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile After this command is executed, we can experience the speed of flying~ whoosh whoosh whoosh~ Wait a minute (Erkang emoticon), by the way, let me mention a few commands that Mingge often uses. Several basic commands for brew •Query software brew search software name • Install the software brew install software name • Start | Stop | Restart the software For software that needs to run in the background, most of them can be started|stopped|restarted in the following ways (the principle is to use launchctl+plist, and the software started in this way It will also start automatically after restarting the computer) For the principles and detailed usage of brew services, you can refer to: Mac Service Management – launchd, launchctl, LaunchAgent, LaunchDaemon, brew services detailed explanation. • Uninstall software brew uninstall software name • View software information brew info software name • See what software is installed brew list software name • See what software is installed brew list software name • View Help brew help The above are several commonly used commands of brew. Finally, let me talk about it again and mention it more about how to break up with brew gracefully. Uninstall brew Because we used the official installation method at the beginning, we still use the official uninstall method: /usr/bin/ruby -e "$(curl -fsSL https://mirrors.aliyun.com/homebrew/brew/install/master/uninstall)" Summarize The above is what I introduced to you about installing Homebrew on Mac. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: In-depth understanding of Vue's data responsiveness
>>: Summary of MySQL password modification methods
Table of contents 1. Unzip 2. Create a data folde...
Table of contents Preface Introduction to Dockerf...
Table of contents Purpose of Teleport How Telepor...
I believe that many friends who are new to web pag...
A few days ago, I watched a video of a foreign gu...
Table of contents 1. What is JSONP 2. JSONP cross...
Mine is: <!DOCTYPE html> Blog Garden: <!...
Type yum install mysql-server Press Y to continue...
The default MySQL version under the Alibaba Cloud...
Today, when I was writing a small program, I used...
Get the current date + time (date + time) functio...
Without further ado, let’s get straight to the co...
Table of contents Setting up a basic HTTP request...
1. Use Canvas images as CSS background images The...
Table of contents introduce Support Intel CPU Sup...