You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 16.04 Linux VPS部署Discord音乐机器人时FFmpeg安装失败求助

Hey there! Let’s dive into fixing this FFmpeg installation problem on your Ubuntu 16.04 VPS for your Discord music bot. I’ve dealt with similar frustrations on older Ubuntu releases before, so here are some reliable steps to get it working:

Step 1: Update Your System First

Start by refreshing your package lists and upgrading existing software—this ensures you’re working with the latest available versions from your sources:

  • Run these commands in your terminal:
    sudo apt-get update
    sudo apt-get upgrade -y
    
Step 2: Install FFmpeg from the Multiverse Repository

FFmpeg is available in Ubuntu’s multiverse repository, which might not be enabled by default on some systems:

  • Enable the multiverse repository:
    sudo add-apt-repository multiverse
    
  • Refresh your package lists again:
    sudo apt-get update
    
  • Install FFmpeg:
    sudo apt-get install ffmpeg -y
    
  • Verify the installation by running:
    ffmpeg -version
    
    If you see version information printed, you’re good to go! If not, move to the next step.
Step 3: Switch to Ubuntu 16.04 Archive Sources (If Default Sources Are Broken)

Ubuntu 16.04 reached end-of-life (EOL) in 2021, so its default package sources are no longer maintained. You’ll need to switch to the official archive sources to get working packages:

  • First, back up your current sources list (just in case):
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    
  • Open the sources list file for editing:
    sudo nano /etc/apt/sources.list
    
  • Replace all existing content with these archive sources:
    deb http://old-releases.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    deb http://old-releases.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
    
  • Save and exit the editor: Press Ctrl+O, hit Enter, then press Ctrl+X.
  • Refresh your package lists again:
    sudo apt-get update
    
  • Now try installing FFmpeg again with the command from Step 2.
Step 4: Compile FFmpeg from Source (For Persistent Issues)

If the above methods still fail, compiling FFmpeg directly from source will give you full control and ensure compatibility with your system:

  • Install the required build dependencies:
    sudo apt-get install build-essential git libssl-dev yasm libx264-dev libx265-dev libfdk-aac-dev libmp3lame-dev libopus-dev -y
    
  • Clone the FFmpeg source code repository:
    git clone https://git.ffmpeg.org/ffmpeg.git
    
  • Navigate into the source directory:
    cd ffmpeg
    
  • Check out a stable version compatible with Ubuntu 16.04 (we’ll use 4.4.3, which works well):
    git checkout n4.4.3
    
  • Configure the build with support for common codecs needed for Discord music bots:
    ./configure --enable-gpl --enable-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libx264 --enable-libx265 --enable-nonfree
    
  • Compile the source code (use -j$(nproc) to speed up compilation with all available CPU cores):
    make -j$(nproc)
    
  • Install the compiled FFmpeg:
    sudo make install
    
  • Verify the installation with ffmpeg -version—you should now see the compiled version listed.
Final Check: Configure Your Discord Bot

Once FFmpeg is installed, make sure your bot can find it:

  • Run which ffmpeg in the terminal to get the full path to the executable (e.g., /usr/local/bin/ffmpeg).
  • Ensure your bot’s configuration points to this path, or that FFmpeg is in your system’s PATH environment variable (most installations will handle this automatically).

内容的提问来源于stack exchange,提问作者dndrhead

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 04:27:17