vcpkg is a C and C++ package manager for library collection and management.
You can download over 1,500 open source libraries or add your own.
It is maintained by the Microsoft C++ team and open source contributors.
In this tutorial you will learn how to install vcpkg on Ubuntu, test it and uninstall it.
- How to install vcpkg on Ubuntu
- How to check vcpkg on Ubuntu
- How to Uninstall vcpkg on Ubuntu
How to install vcpkg on Ubuntu
To install vcpkg on Ubuntu, you need to prepare the environment and install vcpkg from the GitHub repository.
Step 1: Prepare the environment
update sudo apt sudo apt install -y zip unzip
Step 2: Install the build-essential and pkg-config packages
install sudo apt -y build-essential pkg-config
Step 3: Install vcpkg from GitHub
wget -O vcpkg.tar.gz https://github.com/microsoft/vcpkg/archive/master.tar.gz
Step 4: Create a new folder to contain vcpkg and extract the tar.gz . file
sudo mkdir /opt/vcpkg sudo tar xf vcpkg.tar.gz –strip-components=1 -C /opt/vcpkg
Step 5: Build vcpkg
sudo /opt/vcpkg/bootstrap-vcpkg.sh
Step 6: Create a symlink to the vcpkg command in “/usr/local/bin”
sudo ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg
Step 7: Check vcpkg version
vcpkg version
Step 8: Delete the tar.gz . file
rm -rf vcpkg.tar.gz
How to check vcpkg on Ubuntu
To test vcpkg on Ubuntu you need to install the zlib library and get a list of installed libraries by running two separate commands.
1. Install the zlib . library
sudo vcpkg install zlib:x64-linux
2. Get a list of installed libraries
list sudo vcpkg
How to Uninstall vcpkg on Ubuntu
To completely uninstall vcpkg on Ubuntu, you need to delete the vcpkg installation directory, remove the symlinks, clear the cache and related directories, and also uninstall the related packages and dependencies.
1. Delete vcpkg . installation directory
sudo rm -rf /opt/vcpkg
2. Remove symbolic link
sudo rm -rf /usr/local/bin/vcpkg
3. Clear cache and related folders
sudo rm -rf /root/.cache/vcpkg sudo rm -rf /root/.vcpkg rm -rf ~/.vcpkg
4. Uninstall related packages and dependencies
sudo apt purge –autoremove -y zip unzip build-essential cpp make binutils pkg-config
read more
How to install GCC 11 on Ubuntu
How to install jq on Ubuntu
What is LD_LIBRARY_PATH?
Categories: How to
Source: thpttranhungdao.edu.vn/en/