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

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/

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu操作系统中,root是超级用户,也是系统的管理员。因此,当我们通过安装软件包管理器(如apt-get或apt)来安装新的应用程序时,默认情况下程序的所有者是root用户。这是因为root用户具有系统的最高权限,可以访问并控制系统的所有资源和文件。 由于root用户拥有如此大的权限,它可以对系统进行完全的操作和配置更改,包括安装、修改和删除应用程序。因此,将应用程序的所有权授予root用户可以确保系统的稳定性和安全性,因为一般用户无法更改或删除这些应用程序。 然而,对于一些常见的桌面应用程序,这种设置可能不太方便,因为root用户的权限可能过于强大,不适合一般用户使用。因此,在某些情况下,我们可能需要将应用程序的所有者更改为当前登录用户,以便该用户可以自由使用这些应用程序而不需要root权限。 要更改应用程序的所有者,我们可以使用chown命令。例如,假设我们想将应用程序的所有者更改为当前用户,可以执行以下命令:chown current_user:current_user app_name 这将把应用程序的所有者更改为当前用户,并将其所属的组也更改为相应的组。这样,当前用户就可以访问和使用该应用程序了。 总结而言,Ubuntu自己添加的应用程序默认所有者是root用户。但是,我们可以使用chown命令将应用程序的所有者更改为当前用户,以便一般用户可以自由访问和使用这些应用程序

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值