This topic describes how to install ossfs.
Prerequisites
Ensure that the FUSE version in your Linux system is 2.8.4 or later.
You can run the fusermount -V
command on the command line to check whether the FUSE version meets the requirements. If the value of fusermount version in the returned result is 2.8.4 or later (for example, fusermount version: 2.9.2
), the FUSE version meets the requirements. If the version does not meet the requirements, upgrade FUSE to 2.8.4 or later.
Package installation
Download URLs
The following table lists the installation packages for common operating systems. If your operating system version is not included, install ossfs from source code.
Linux distribution | Package | URL |
Ubuntu 22.04 (x64) | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_ubuntu22.04_amd64.deb | |
Ubuntu 20.04 (x64) | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_ubuntu20.04_amd64.deb | |
Ubuntu 18.04 (x64) | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_ubuntu18.04_amd64.deb | |
Ubuntu 16.04 (x64) | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_ubuntu16.04_amd64.deb | |
CentOS 8.0 (x64) | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_centos8.0_x86_64.rpm | |
CentOS 7.0 (x64) | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_centos7.0_x86_64.rpm | |
Anolis8/Alibaba Cloud Linux 3 | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_alinux3_x86_64.rpm | |
Anolis7/Alibaba Cloud Linux 2 | https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_alinux2_x86_64.rpm |
Installation steps
Install ossfs.
Copy the URL of the package for your operating system and follow these steps to complete the installation.
Ubuntu systems
The following example shows how to install ossfs on Ubuntu 22.04 (x64). Run the following commands in sequence:
sudo wget https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_ubuntu22.04_amd64.deb sudo apt-get update sudo apt-get install gdebi-core sudo gdebi ossfs_1.91.6_ubuntu22.04_amd64.deb
CentOS systems/Anolis systems/Alibaba Cloud Linux systems
The following example shows how to install ossfs on CentOS 7.0 (x64):
sudo wget https://gosspublic.alicdn.com/ossfs/ossfs_1.91.6_centos7.0_x86_64.rpm sudo yum install ossfs_1.91.6_centos7.0_x86_64.rpm
If your client uses Yellowdog Updater, Modified (YUM) to install RPM packages, dependencies may fail to be downloaded using YUM due to network environment factors on the client node. To resolve this issue, you can use YUM to download the dependencies over the normal network to a node that runs the same operating system version, and then copy the dependencies to the required node. For example, ossfs requires FUSE 2.8.4 or later. You can run the following command to download the latest version of FUSE from the YUM repository to your local computer:
sudo yum install --downloadonly --downloaddir=./ fuse
ImportantTo download other dependencies, replace fuse with the name of the required package.
ossfs queries the content in the /etc/mime.types file to set the Content-Type of files. If you want the Content-Type of uploaded files to match their file name extensions, you need to add the mime.types file.
If you do not add the mime.types file, ossfs sets the Content-Type of uploaded files to application/octet-stream by default.
Run the following command to add the mime.types file:
Ubuntu systems
Run the following command to add the mime.types file:
sudo apt-get install mime-support
CentOS systems/Anolis systems/Alibaba Cloud Linux systems
Run the following command to add the mime.types file:
sudo yum install mailcap
Run the
ossfs --version
command to view the ossfs version information. If the information shown in the following figure appears, the installation is successful.
Source code installation
For operating systems other than those listed below, you need to install the corresponding dependencies (such as fuse-devel) yourself. Additionally, we do not recommend using ossfs on other operating systems.
Install the dependencies required for compilation
Ubuntu systems
The following example shows how to install the dependencies required for compilation on Ubuntu systems:
sudo apt-get update sudo apt-get install automake autotools-dev g++ git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
CentOS systems/Anolis systems/Alibaba Cloud Linux systems
The following example shows how to install the dependencies required for compilation on CentOS systems:
sudo yum makecache sudo yum install automake gcc-c++ git libcurl-devel libxml2-devel fuse-devel make openssl-devel
CentOS Stream systems
Run the following commands to install the EPEL repository and enable the CRB repository:
sudo dnf install -y epel-release sudo dnf config-manager --set-enabled crb
Run the following commands to install the dependencies required for compilation:
sudo dnf makecache sudo dnf install -y automake gcc-c++ git libcurl-devel libxml2-devel fuse-devel make openssl-devel
Run the following commands to download the source code from GitHub and compile and install ossfs:
git clone https://github.com/aliyun/ossfs.git cd ossfs ./autogen.sh ./configure make sudo make install
Run the
ossfs --version
command to view the ossfs version information. If the information shown in the following figure appears, the installation is successful.
What to do next
After you install ossfs 1.0, you need to configure the mounting environment required for ossfs 1.0 to mount OSS buckets. For more information, see Configure ossfs 1.0.