如何在Ubuntu上更改默认应用程序:4种方法

您所在的位置:网站首页 默认打开app怎么取消设置 如何在Ubuntu上更改默认应用程序:4种方法

如何在Ubuntu上更改默认应用程序:4种方法

2024-07-04 09:36| 来源: 网络整理| 查看: 265

image

There are several ways to change your default applications on Ubuntu. Whether you’re changing the default application for a particular task, file type, or a system-level application like your default text editor, there’s a different place to go.

有几种方法可以更改Ubuntu上的默认应用程序。 无论您是要更改特定任务,文件类型的默认应用程序,还是要更改系统级应用程序(例如默认文本编辑器),都可以选择其他方法。

Unlike on Windows, applications won’t take over existing file extensions during the installation process — they’ll just appear as an option after you install them.

与Windows不同,应用程序在安装过程中不会接管现有的文件扩展名-安装后,它们只会作为选项出现。

桌面应用 (Desktop Applications)

To set your default desktop applications for actions such as Web Browser, Email, or Video, open the System Settings window from the panel.

要将默认桌面应用程序设置为执行Web浏览器,电子邮件或视频之类的操作,请从面板中打开“系统设置”窗口。

image

Select the Details icon in the System Settings window.

在“系统设置”窗口中选择“详细信息”图标。

image

Select the Default Applications category and use the drop-down boxes to select a default application. Application will appear here after you’ve installed them – for example, you can install VLC and select it as your default video player from here.

选择默认应用程序类别,然后使用下拉框选择默认应用程序。 安装它们后,应用程序将显示在此处–例如,您可以安装VLC并从此处将其选择为默认视频播放器。

image 可移动媒体 (Removable Media)

From the Details control panel, you can also select your default applications for different types of removable media. By default, Ubuntu will ask you what application you want to use when you insert a removable media device. You can change this – for example, you can have Rhythmbox automatically open and play audio CDs when you insert them.

在“详细信息”控制面板中,您还可以为不同类型的可移动媒体选择默认应用程序。 默认情况下,Ubuntu会在插入可移动媒体设备时询问您要使用哪种应用程序。 您可以更改此设置–例如,可以在插入CD时让Rhythmbox自动打开并播放音频CD。

image 文件关联 (File Associations)

To set the default application for a specific file type, locate a file of that type in the file manager, right-click it, and select Properties.

要为特定文件类型设置默认应用程序,请在文件管理器中找到该类型的文件,右键单击它,然后选择“属性”。

image

Click the Open With tab and select the application you want to use for that file type. Use the Set as default button to make the application the default application.

单击“打开方式”选项卡,然后选择要用于该文件类型的应用程序。 使用“设为默认”按钮将应用程序设置为默认应用程序。

image 更新替代 (Update-Alternatives)

Ubuntu uses the update-alternatives system it inherited from Debian to control default applications outside of the graphical desktop. For example, when you run a command that uses a terminal text editor, the command calls /usr/bin/editor. /usr/bin/editor isn’t an editor itself – it’s a symbolic link to an editor on your system. This link points to the nano text editor by default, but you can select a different default text editor with the update-alternatives command. If only one option is available for an alternative – for example, if you only have one Java virtual machine installed – it will be used as the default.

Ubuntu使用从Debian继承的更新替代系统来控制图形桌面之外的默认应用程序。 例如,当您运行使用终端文本编辑器的命令时,该命令将调用/ usr / bin / editor。 / usr / bin / editor本身不是编辑器–它是系统上编辑器的符号链接。 默认情况下,此链接指向nano文本编辑器,但是您可以使用update-alternatives命令选择其他默认文本编辑器。 如果只有一个选项可供选择(例如,如果您仅安装了一个Java虚拟机),它将用作默认选项。

For example, let’s say you wanted to change the system’s default text editor. Run the following command in a terminal:

例如,假设您要更改系统的默认文本编辑器。 在终端中运行以下命令:

sudo update-alternatives –config editor

sudo update-alternatives –配置编辑器

You’ll see a list of installed editors to choose from – type the number of the editor you want to use and press Enter.

您将看到一个已安装的编辑器列表,供您选择–键入要使用的编辑器的编号,然后按Enter。

image

To go through the choices for every alternative on your system, run the following command:

要查看系统上每个备用选项的选择,请运行以下命令:

sudo update-alternatives –all

sudo update-alternatives –全部

You’ll only see a prompt if multiple applications that could satisfy an alternative are installed on your system. To keep the default option for an alternative, just press Enter.

如果系统上安装了可以满足替代要求的多个应用程序,则只会显示提示。 要保留默认选项,只需按Enter。

image

翻译自: https://www.howtogeek.com/117709/how-to-change-your-default-applications-on-ubuntu-4-ways/



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3