Monday, September 4, 2017

Install Wine on Ubuntu 17.04

1. If you have disabled your system update options, enable them. Keep Ubuntu Up to date. Ubuntu automatically notifies when updates are available. (Important)
sudo apt-get update
sudo apt-get upgrade
Update: Synchronizes your list of available packages with the servers in source repositories. Upgrade: Downloads & installs any newer versions of your installed packages.

2. If your system is 64 bit, enable 32 bit architecture (if you haven't already):
sudo dpkg --add-architecture i386 

If you have previously installed a Wine package from another repository, please remove it and any packages that depend on it (e.g., wine-mono, wine-gecko, winetricks) before attempting to install the WineHQ packages, as they may cause dependency conflicts.

3.  Add the repository:
wget https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository 'https://dl.winehq.org/wine-builds/ubuntu/'
 
4. Update packages:
sudo apt-get update 

5.Then install one of the following packages:
Stable branch
sudo apt-get install --install-recommends winehq-stable
Development branch
sudo apt-get install --install-recommends winehq-devel
Staging branch
sudo apt-get install --install-recommends winehq-staging
If apt-get complains about missing dependencies, install them, then repeat the last two steps (update and install).

@reference_1_wiki.winehq.org
Ubuntu - Installing WineHQ packages
@reference_2_askubuntu.com
How do I resolve unmet dependencies after adding a PPA?


Other Advices:

1. Use aptitude instead of apt-get


Use aptitude instead of apt-get. It is more intelligent. It not only will handle downgrading conflicting packages for you, but will make a series of recommendations asking you which of many possible suggested working scenarios you would like.
sudo aptitude install myNewPackage
If you don't have aptitude on your machine yet, get it with
sudo apt-get install aptitude

2. Clean up your system
recommend trying the following commands.
sudo dpkg --configure -a
sudo apt-get install -f
Answer yes to any prompts and let apt-get try to resolve the issue for you.
EDIT:
try the following command it should clean up your system.
sudo sh -c "apt-get update;apt-get dist-upgrade;apt-get autoremove;apt-get autoclean"


3. Enable all the repositories

If the error shows something like this:
<some-package>: Depends: <other-package> (= version) but this-version is to be installed
Then make sure that the restricted and universe repositories are enabled. Hit Alt+F2, type software-properties-gtk in search bar and hit Enter.
Under Ubuntu Software tab, enable all the repositories.


 4. Remove or purge PPA

Use the --remove flag, similar to how the PPA was added:
sudo add-apt-repository --remove ppa:whatever/ppa
As a safer alternative, you can install ppa-purge:
sudo apt-get install ppa-purge
And then remove the PPA, downgrading gracefully packages it provided to packages provided by official repositories:
sudo ppa-purge ppa_name
Note that this will uninstall packages provided by the PPA, but not those provided by the official repositories. If you want to remove them, you should tell it to apt:
sudo apt-get purge package_name
You can also remove PPAs by deleting the .list files from /etc/apt/sources.list.d directory.

you can also disable or remove PPAs from the "Software Sources" section in Ubuntu Settings with a few clicks of your mouse (no terminal needed).

Do not forget to update with:
sudo apt-get update

To get a list of repositories apt-get is checking, run the following command:
apt-cache policy

5. Other solutions
  • One possible cause of unmet dependencies could be corrupted package database, and/or some packages weren’t installed properly. To fix this problem, hit Alt+Ctrl+T to open terminal and try to run one of the following commands:
    sudo apt-get clean
    or,
    sudo apt-get autoclean
    apt-get clean clears out the local repository of retrieved package files (the .deb files). It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. apt-get autoclean clears out the local repository of retrieved package files, but unlike apt-get clean, it only removes package files that can no longer be downloaded, and are largely useless.
  • One of the most basic fixes to resolve dependencies problems is to run:
    sudo apt-get -f install
    The -f here stands for “fix broken”. Apt will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies, if possible, otherwise it may simply remove the package that you installed in order to resolve the problem.
    Then run:
    sudo dpkg --configure -a
    Then run this again:
    sudo apt-get -f install
    If the output is:
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    That means it failed.
  • Next solution is to run:
    sudo apt-get -u dist-upgrade
    If it shows any held packages, it is best to eliminate them. Packages are held because of dependency conflicts that apt cannot resolve. Try this command to find and repair the conflicts:
    sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
    If it cannot fix the conflicts, it will exit with:
    0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
    Delete the held packages one by one, running dist-upgrade each time, until there are no more held packages. Then reinstall any needed packages. Be sure to use the --dry-run option, so that you are fully informed of consequences:
    sudo apt-get remove --dry-run package-name
    Since removing the package you are trying to install may not be ideal, you might also try finding a repository that has the packages you need to satisfy the dependencies.
Finally, if all else fails, you can attempt to satisfy the dependencies yourself, either by finding and installing the necessary packages, or by installing them from source and then creating “deb” packages for them.

@reference_3_askubuntu.com
E: Unable to correct problems, you have held broken packages
@reference_4_askubuntu.com
How to fix dependencies / broken packages [duplicate]
@reference_5_askubuntu.com
How do I resolve unmet dependencies after adding a PPA?
@reference_6_askubuntu.com
How can PPAs be removed?
How to get a list of repositories apt-get is checking?


No comments:

Post a Comment